Borrar filtros
Borrar filtros

I run this identity test and get this response....what am I doing wrong

1 visualización (últimos 30 días)
David Craven
David Craven el 9 de Sept. de 2017
Editada: Stephen23 el 9 de Sept. de 2017
function result = singularitytest(A)
d = det(A);
c = cond(d) <= 1e-10;
end
Output argument "result" (and maybe others) not assigned during call to "singularitytest".

Respuestas (1)

Stephen23
Stephen23 el 9 de Sept. de 2017
Editada: Stephen23 el 9 de Sept. de 2017
You define a function with one output argument result:
function result = singularitytest(A)
Inside the function you define several variables, but you do not define result anywhere. Thus the error: if you do not tell MATLAB what result is, how do you expect it to return anything?
Perhaps you meant to do this:
function result = singularitytest(A)
d = det(A);
result = cond(d) <= 1e-10;
end

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by