Reshape to column vector
2 次查看(过去 30 天)
显示 更早的评论
I have
a =
1 2 3 4
5 6 7 8
9 10 11 12
I need to covert it to a column vector keeping the input order as follows,
b =
1
2
3
4
.
.
12
But when you use reshape funtion
b = [reshape(a,[12,1])]
b =
1
5
9
2
6
10
3
7
11
4
8
12
Can anyone help me on this?
0 个评论
回答(1 个)
Star Strider
2021-10-9
Transpose ‘a’ before calling reshape —
a = [1 2 3 4
5 6 7 8
9 10 11 12];
b = reshape(a.',[],1)
.
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!