Sacar N submatrices de una matriz
6 ビュー (過去 30 日間)
古いコメントを表示
Isabel Aldana Benavides
2020 年 4 月 25 日
コメント済み: Isabel Aldana Benavides
2020 年 4 月 25 日
Hola
Tengo una matriz de N columnas, por 4 filas, esas N columnas son multiplos de 200, yo quiero sacar las N submatrices, cada 200, es decir si tengo 1000 columnas sacar las columnas 1,201,401,601,801, y esta ser una submatriz, asimismo para las columnas 2,202,402,602,802... y asi hasta 200,400,600,800,1000.
Alguna idea?
Muchas gracias
0 件のコメント
採用された回答
Sriram Tadavarty
2020 年 4 月 25 日
HI Isabel,
You wanted to have submatrices which are having columns spread by 200 each. This can be done with a for loop as such:
x = randi([0 100],4,1000); % Arandom matrix of size 4 x 1000
tmp = cell(1,200);
for i = 1:200
tmp{i} = x(:,i:200:end);
end
% Each cell of tmp contains a submatrix which are the columns spread by 200
% each
% For example submatrix 2 can be known with tmp{2}
Hope this helps.
Please do post your upcoming questions in english to reach out wider audience.
Thanking you.
Regards,
Sriram
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!