MATLAB: How to convert a 1X1 vactor into a matrix of 5X5

MATLABmatrix manipulationvector

Hi
I have a vector
[[0, 1, 1, 1, 1], [0, 0, 1, 1, 1], [0, 0, 0, 1, 1], [0, 0, 0, 0, 1], [0, 0, 0, 0, 0]]
I want to convert this into a 5X5 matrix like:
0 1 1 1 1
0 0 1 1 1
0 0 0 1 1
0 0 0 0 1
0 0 0 0 0
How can this be done? Thanks in advance
Sanjeev

Best Answer

(Posting as an Answer)
java.util.Vector objects are vectors and cannot be reshape() into arrays. You would need to pull out the contents of the vectors and assign them into rows.
Alternatives to using java.util.Vector were discussed in https://www.mathworks.com/matlabcentral/newsreader/view_thread/172961