How can I convert 2-D array to 1-D array.
4 次查看(过去 30 天)
显示 更早的评论
I am using a variable oprtn_pts. whose size is 3 2.
I want to convert this into 6*1. How can I do this?
0 个评论
采纳的回答
Andrei Bobrov
2012-9-18
one way
out = oprtn_pts(:);
or
out = oprtn_pts.';
out = out(:);
other:
out = reshape(oprtn_pts,[],1);
or
out = reshape(oprtn_pts.',[],1);
0 个评论
更多回答(1 个)
Wayne King
2012-9-18
编辑:Wayne King
2012-9-18
oprtn_pts = randn(3,2);
oprtn_pts = reshape(a,6,1);
It takes the elements from oprtn_pts columnwise.
3 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!