how to use loops to find matrix determinant

1 回表示 (過去 30 日間)
Stefan
Stefan 2022 年 10 月 6 日
コメント済み: Rahul 2022 年 10 月 13 日
my question asked to use for loops to find determinant of a random matrix.
S = randi([0 9], 3, 3) % generates random matrix
index_row = randi([1,3],1) % picks a random row from matrix
random_ith_row = S(index_row,:) % spits out the numbers from the random row
I am unsure how to use for loops to get the determinant of this random matrix from the row I selected.
  2 件のコメント
John D'Errico
John D'Errico 2022 年 10 月 6 日
Picking a random row from a matrix is meaningless to compute a determinant. You might be thinking about how to use minors for that computation. Do some reading.
Rahul
Rahul 2022 年 10 月 13 日
To calculate determinant, a square matrix is required. You are extracting a row for which determinant can not be calculated. Go through the determinant documentation for more information.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by