フィルターのクリア

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

1 回表示 (過去 30 日間)
Emily Gallagher
Emily Gallagher 2019 年 9 月 24 日
コメント済み: James Tursa 2019 年 9 月 24 日
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 件のコメント
James Tursa
James Tursa 2019 年 9 月 24 日
What is the purpose of creating the A matrix inside this function?

サインインしてコメントする。

採用された回答

KALYAN ACHARJYA
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.
76.png
Hope it helps!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by