numeric array to cell array
2 ビュー (過去 30 日間)
古いコメントを表示
Hi
I want to convert the following numeric array to cell array of cells having two elements each. Any help?
stress = [0 20 -160 150 -40 330 -40 170 -20 180]
what is required is:
cycles = [[0 20] [-160 150] [-40 330] [-40 170] [-20 180]]
2 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 6 月 12 日
編集済み: Azzi Abdelmalek
2013 年 6 月 12 日
cycles=reshape(stress,2,[])
%you can also create cell array
out=arrayfun(@(x) cycles(:,x),1:size(cycles,2),'un',0)
参考
カテゴリ
Help Center および File Exchange で Stress and Strain についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!