Filter löschen
Filter löschen

why do i get in error?

1 Ansicht (letzte 30 Tage)
Nathan Grant
Nathan Grant am 5 Nov. 2015
Beantwortet: Walter Roberson am 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.

Antworten (1)

Walter Roberson
Walter Roberson am 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.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by