Save the elements of different pages of a matrix in a vector
古いコメントを表示
I have a matrix Z 6x100x6 and I would like to store all the elements from the 6th and the 100th column them in vector. So I do
B=(6,100,:)
Matlab the generates again a multidimensional matrix 1x1x6. instead of vector 1x6. Whereas
B=(6,:,1)
will return a vector 1x100 with 100 elements of the first row of the first page. What I am I doing wrong? Thank you
採用された回答
その他の回答 (2 件)
Wayne King
2012 年 12 月 18 日
Use squeeze()
A = randn(6,100,6);
B = squeeze(A(6,:,1));
Giorgos Papakonstantinou
2012 年 12 月 18 日
0 投票
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!