Clear Filters
Clear Filters

why do i get in error?

1 view (last 30 days)
Nathan Grant
Nathan Grant on 5 Nov 2015
Answered: Walter Roberson on 5 Nov 2015
I get this error Output argument "varargout" (and maybe others) not assigned during call to "slsfnagctlr",and want to know how to fix it.

Answers (1)

Walter Roberson
Walter Roberson on 5 Nov 2015
Make sure that in all cases, you assign something to varargout . This includes cases where you return early because the parameters are not correct (unless you use error() for that case.)
One of the common difficulties that people have is that they have something like
for K = 1 : SomeLimit
OutputParameter(K) = SomeValue
end
but forget to take into account the possibility that the SomeLimit might be less than the initial value, causing the for loop to not be done at all. If your only assignment to a variable is in a for loop then you need to be sure that the for loop will always be executed at least once -- or, alternately, that the variable is given a definite value before the for loop so that it will have a value even if the for loop does not execute the body at all.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!