problem solved thank you

1 view (last 30 days)
john hollywood
john hollywood on 22 Feb 2014
Edited: john hollywood on 23 Feb 2014
thank you in ,much apprichated

Answers (1)

Walter Roberson
Walter Roberson on 22 Feb 2014
Hint:
diag(a,b) + diag(c,d)
  4 Comments
john hollywood
john hollywood on 22 Feb 2014
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 on 22 Feb 2014
For a 5x5 matrix, the main diagonal needs to have 5 elements: [2 2 2 2 2].

Sign in to comment.

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!