This feels like a really dumb question because the error message is really straight forward, so I took a while to create as simple of a complete example as I could. It seems like when a constructor is called in a constructor ( I think I first noticed in a normal method not a constructor) and the objects are being put into an array in reverse order then matlab will give a not enough input arguments error for example:
classdef practice
methods
function self = practice(b)
b
if b>1
for i = 2:-1:1
s(i) = practice(b-i);
end
end
end
end
end
called as
practice(4)
gives
b =
4
b =
2
b =
0
Error using practice (line 4)
Not enough input arguments.
Error in practice (line 7)
s(i) = practice(b-i);
Error in practice (line 7)
s(i) = practice(b-i);
This case is odd because it only fails when getting to where b <= 1, but my real code doesn't fail like this. Any ideas on what exactly is going wrong and how I can fix it?