How to change the matrix size and value in matlab code?
Show older comments
Hi everyone,
I'm a newbie in matlab. I have a question and hope to receive your surpport.
I have a matrix 3 columns, n rows, like this:
(column 1 and 2 are integer, column 3 is real number)
1 - 2 - a12,
1 - 3 - a13,
2 - 1 - a21,
2 - 3 - a23,
3 - 3 - a33,
4 - 1 - a41,
4 - 2 - a42,
Now I want to change the matrix above become this matrix: (means that the value of column 1 and column 2 about will become the index of new matrix, if don't have index in some position, the new matrix value at that position will be blank)
NaN - a12 - a13,
a21 - NaN - a23,
NaN - NaN - a33,
a41 - a42 - NaN,
Have anyone help me? I'm looking forward your respond so much :)
2 Comments
Image Analyst
on 7 Jul 2018
I don't know what your edit was, but I did help. My code in my answer below works. Did you try it?
Van Vy
on 7 Jul 2018
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!