easy question- matrix divide

1 回表示 (過去 30 日間)
STamer
STamer 2014 年 5 月 20 日
回答済み: Andrei Bobrov 2014 年 5 月 20 日
Dear friends,
I have relatively easy question for you. I couldn't manage it. I'm loading (dlmread) a huge matrix as a text file to my matlab code.
size(Matrix)= 300 10
I would like to divide this into sub-matrixes. Every 10 row will be a matrix. size(sub-Matrix)=10 10
So, I want to have 30 sub-matrixes. How can I do that?
Example;
Firstly, A=dlmread('A.txt')
A is 300*10 matrix.
A{1} is 10*10 matrix
First 10 Row of A is A{1}.
Second 10 Row of A is A{2}.
.
.
.
30th 10 Row of A is A{30}.

採用された回答

Andrei Bobrov
Andrei Bobrov 2014 年 5 月 20 日
out = mat2cell(A,10*ones(30,1),size(A,2))

その他の回答 (1 件)

Matt J
Matt J 2014 年 5 月 20 日
One way, using MAT2TILES ( Available here ),
A=mat2tiles(A,[10,inf]);

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by