How can I create a 22x22 Matrix from 231 values of the triangular matrix?
1 view (last 30 days)
Show older comments
I have 231 doubles which represent the values of one triangular of the complete matrix. I want to add the diagonal (all 1s) and the complementary triangular to get the full 22x22 matrix (which I need for the next task).
This is the closest I've got so far:
test = horzcat(tri,tri)
reshape(test,22,22,[])
Error using reshape
Product of known dimensions, 484, not divisible into total number of elements, 462.
The error is due to the fact that the diagonal (22x1) is missing, but I don't know how to add that...
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Operating on Diagonal 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!