Reshape matrix to have the same value every 30 cells
1 次查看(过去 30 天)
显示 更早的评论
Hi All,
I have a question: I have a matrix
A=[10; 20; 30; 40; 50; 50; 60]
How can I reshape it in order to have a matrix (7x30) X 1 such that the first 30 values are A(1), the next 30 have value of A(2), and so on...
thanks
nikolas
0 个评论
采纳的回答
Guillaume
2018-2-19
This is not a reshape it's a repmat:
repmat(A, 1, 30)
1 个评论
Jos (10584)
2018-2-19
Just to be nitpicking :D ... the first 30 values of A, retrieved by A(1:30) will be [10 20 30 40 50 60 70 10 20 ...] because A is a column vector and Matlab stores values columnwise.
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!