Covering some basic topics I haven't seen elsewhere on Cody.
Remove the singleton dimensions from the input variable (e.g. if size(input)==[2 3 1 4], size(output)==[2 3 4])