Why do I keep getting an undefined function for 'deter'?

Trying to find the determinant of an upper triangular matrix without using the built-in det function. Why do I keep getting an undefined function error for 'deter'?
function d = deter (U)
n = 4;
A = rand(n,n);
d = prod(diag(U));
end

1 comentario

What is the purpose of creating the A matrix inside this function?

Iniciar sesión para comentar.

 Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 24 de Sept. de 2019
Editada: KALYAN ACHARJYA el 24 de Sept. de 2019
function d=deter (U)
n=4;
A=rand(n,n);
d=prod(diag(U));
end
Save the function in new matlab file (save as deter.m), Next call the function from command window or another main script. Please note that you have pass the input arguments (U) to the function form command window or another main Matlab script as shown below.
76.png
Hope it helps!

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Sept. de 2019

Comentada:

el 24 de Sept. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by