Change a 3x100 double to a 300x1 double
6 次查看(过去 30 天)
显示 更早的评论
I have a 3 x 100 double ie. 100 column vectors next to each other all with 3 rows, and I need to take each column vector and put them all on top of each other in one long 300 x 1 column vector, what would be the easiest way of doing this?
I appreciate there is help material on idexing matrices but I could not find anything which particularly explains how to do this.
0 个评论
采纳的回答
madhan ravi
2019-3-24
reshape(a.',[],1) % a is of size 3 X 100
2 个评论
madhan ravi
2019-3-24
编辑:madhan ravi
2019-3-24
a = [ 1 8 9 ;...
2 6 4 ;...
4 2 3 ]
Result = reshape(a,[],1)
%or
Result = a(:)
Gives:
Result =
1
2
4
8
6
2
9
4
3
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!