Why do I keep getting an undefined function for 'deter'?
조회 수: 2 (최근 30일)
이전 댓글 표시
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
채택된 답변
KALYAN ACHARJYA
2019년 9월 24일
편집: KALYAN ACHARJYA
2019년 9월 24일
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.
Hope it helps!
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!