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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by