Don't understand my error mention
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I get the folowing error mention:
Error in ==> trapezes at 3
if(n<1)
??? Output argument "Itr" (and maybe others) not assigned during
call to "C:\Users\Lerak\Documents\MATLAB\trapezes.m>trapezes".
Error in ==> principal_1 at 45
poidstra=trapezes(o);
Could somebody explain me what this really means?
0 Kommentare
Antworten (1)
Kevin Claytor
am 2 Aug. 2012
Can you post the code to trapezes - the error message says the problem is in there, you have something like;
function Itr=trapezes(n)
if n<1
Itr = 5;
end
end
The problem here is that if n > 1, there is no case that assigns Itr, so there is no output variable. You could use;
function Itr=trapezes(n)
Itr=0;
if n<1
Itr = 5;
else
Itr = 1;
end
end
Now you have a success case, a fail case, and a default case that you can check against.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!