Filter löschen
Filter löschen

using mat2cell

3 Ansichten (letzte 30 Tage)
Joseph Lee
Joseph Lee am 31 Okt. 2017
Kommentiert: Star Strider am 31 Okt. 2017
M is matrix of 2010x1300
how do i form 201 cells of 10x1300 using mat2cell?

Akzeptierte Antwort

Star Strider
Star Strider am 31 Okt. 2017
This works:
M = randn(2010, 1300);
C = mat2cell(M, 201*ones(1,10), 1300);
See the documentation for an explanation.
  4 Kommentare
Joseph Lee
Joseph Lee am 31 Okt. 2017
thanks!
Star Strider
Star Strider am 31 Okt. 2017
My pleasure!
Since my Answer solves the problem you originally posted, please Accept it!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

M
M am 31 Okt. 2017
Maybe not the easiest solution, but try something like :
j=1;
for i=1:10:201
A{j}=M(i:i+9,:);
j=j+1;
end
  1 Kommentar
Joseph Lee
Joseph Lee am 31 Okt. 2017
Your solution worked but without the 10
for i=1:201
A{j}=M(i:i+9,:);
j=j+1;
end

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by