Function call doesn't work in script, works in command window
51 views (last 30 days)
I have a function that calls a sub-function within the same file: in main.m:
... %calculations for a,b,c,d,e,f,g,h
When I run main(), the program errors on the call to TimeCalculations(). The error output is: too many output arguments. However, when I put a breakpoint at this line and then copy the line directly into the command window, I do not receive and error. Has anyone run into a similar scenario and how did they fix it?
Matt J on 17 Jul 2018
My only theory - you have another version of TimeCalculations which is not a sub-function. When you copy the call to the command window, it is that version which gets called. From the breakpoint, use the debugger controls to step into TimeCalculations() to see exactly where you are and what is getting computed.