Borrar filtros
Borrar filtros

Don't understand my error mention

5 visualizaciones (últimos 30 días)
Karel
Karel el 2 de Ag. de 2012
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?

Respuestas (1)

Kevin Claytor
Kevin Claytor el 2 de Ag. de 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.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by