convert vector to matrix
16 ビュー (過去 30 日間)
古いコメントを表示
Hi all, I would like to convert a vector
A = [1,2,3,4,5,6]
to
matrix like that:
B=
[1 2 3,
4 5 6]
I tried to use reshape and I don't have vec2mat function. Do you have an idea? thank you
0 件のコメント
採用された回答
Star Strider
2018 年 10 月 31 日
Try this:
A = [1,2,3,4,5,6];
B = reshape(A(:), 3, []).'
B =
1 2 3
4 5 6
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
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!