use the mat2cell function
8 ビュー (過去 30 日間)
古いコメントを表示
Now i have a 5*100 matrix, how to convert it to a 5*10 cell and each cell contain 1*10?
0 件のコメント
回答 (2 件)
David Hill
2021 年 3 月 23 日
b=mat2cell(a,[1 1 1 1 1],[[10 10], [10 10], [10 10], [10 10], [10 10]]);
0 件のコメント
Star Strider
2021 年 3 月 23 日
Try this:
A = randi(9, 5, 100); % Create Matrix To Test Code
C = mat2cell(A, ones(5,1), ones(1,10)*10) % Desired Result
.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!