How can i write and use the attached matrix in MATLAB for any value of N

1 回表示 (過去 30 日間)
Thanakrits Somma
Thanakrits Somma 2020 年 8 月 9 日
コメント済み: Thanakrits Somma 2020 年 8 月 9 日
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 8 月 9 日
That is clearly a homework assignment, so if we were to answer showing you how to create the matrix, we would have to deliberately make a long program.

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

回答 (1 件)

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2020 年 8 月 9 日
編集済み: Abdolkarim Mohammadi 2020 年 8 月 9 日
M = (n:-1:0) + (0:n)';
or
M = (n:2*n)' - (0:n);
  3 件のコメント
Abdolkarim Mohammadi
Abdolkarim Mohammadi 2020 年 8 月 9 日
Sorry Walter. I wasn't aware of this. I agree with you that the best way of learning is trying to figure out the code.
Thanakrits Somma
Thanakrits Somma 2020 年 8 月 9 日
Thanks for the advice, now I can finish writing the code. For Abdolkarim Mohammadi-Balani's code, I'll put it down for further study.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by