saving matrix elements into array
58 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have 9 matrices with size 500x2. I would like to save them into a 3x3 array; i.e. my first 500x2 matrix be the first element of my 3x3 matrix and so on. Can you please help me?
0 件のコメント
採用された回答
Jos (10584)
2011 年 4 月 18 日
You can use a cell array for this
X = cell(3,3)
X{1,1} = My500by2Matrix1 ;
% etc.
.. or use a 4D matrix
X = zeros(3,3,500,2) ;
X(1,1,:) = My500by2Matrix1 ;
% etc.
% and use squeeze to obtain a particular matrix
squeeze(X(3,2,:,:))
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!