답변 (1개)

Walter Roberson
Walter Roberson 2014년 2월 22일

0 개 추천

Hint:
diag(a,b) + diag(c,d)

댓글 수: 4

john hollywood
john hollywood 2014년 2월 22일
sorry i been stuck on this question for past couple hours. it would be great help you if you could explain lil more. thanks, much appreciated
Walter Roberson
Walter Roberson 2014년 2월 22일
Did you try playing with the Example on the diag documetnation? Assign an integer value to "m" and then run the line of code and see what it gives. Then start picking apart the parts of the expression to see how the parts fit together.
john hollywood
john hollywood 2014년 2월 22일
sorry i really confuse diag([2 2 2 2 ]), diag([-1 -1 -1 -1], 2), diag([-1 -1 -1 -1],-1) i got this but its not giving the right answer . what am doing wrong ?
Star Strider
Star Strider 2014년 2월 22일
For a 5x5 matrix, the main diagonal needs to have 5 elements: [2 2 2 2 2].

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2014년 2월 22일

편집:

2014년 2월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by