create cell from array with specified size
古いコメントを表示
Hello,
Let mymatrix a 24x1 double, how is it possible to obtain a group as specified_sizex1 cell?
For example:
mymatrix=[1:24];
group={[mymatrix(1) mymatrix(2)],...}
採用された回答
その他の回答 (2 件)
Fangjun Jiang
2023 年 12 月 19 日
0 投票
num2cell(mymatrix)
2 件のコメント
Gaetano Pavone
2023 年 12 月 19 日
Fangjun Jiang
2023 年 12 月 19 日
mat2cell(mymatrix,[1],[6, 6, 6, 6])
mymatrix = (1:24).'
specified_size = 4;
assert(mod(numel(mymatrix),specified_size)==0, ...
'numel(mymatrix) is not a multiple of specified_size')
group = num2cell(reshape(mymatrix,[],specified_size).',2)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!