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

4 次查看(过去 30 天)
  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
M = (n:-1:0) + (0:n)';
or
M = (n:2*n)' - (0:n);
  3 个评论
Abdolkarim Mohammadi
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 CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by