Feb 17, 2004 #1 ill2000m Electrical Joined Oct 7, 2003 Messages 7 Location GB I am a new user in matlab . just wonder if anyone know how to use matrix in matlab to do the following i got 12 and wish to turn it into 1122 34 1122 3344 3344 like the following .. i dont know which matlab command i should use 12 34 = 1122 1122 3344 3344
I am a new user in matlab . just wonder if anyone know how to use matrix in matlab to do the following i got 12 and wish to turn it into 1122 34 1122 3344 3344 like the following .. i dont know which matlab command i should use 12 34 = 1122 1122 3344 3344
Feb 17, 2004 #2 MikeyP Aerospace Joined Mar 5, 2002 Messages 940 Location GB This should work for your 2x2 case. I'll leave it to you to extend it to nxn. Code: A = [1 2 3 4] X = [1 0 1 0 0 1 0 1] B = X*A*X' M -- Dr Michael F Platten Upvote 0 Downvote
This should work for your 2x2 case. I'll leave it to you to extend it to nxn. Code: A = [1 2 3 4] X = [1 0 1 0 0 1 0 1] B = X*A*X' M -- Dr Michael F Platten