Select rows and put into cell array

7 vues (au cours des 30 derniers jours)
Setiadi Suriana
Setiadi Suriana le 24 Mai 2019
Commenté : madhan ravi le 24 Mai 2019
I have 10000 rows and I want separate into 10 cell arrays with
Array Row
Cell array 1: 1
11
21
31
and so on
Cell array 2: 2
12
22
32
and so on
Until Cell array 10

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 24 Mai 2019
A=rand(10000,5);
result=cell(1,10);
for i=1:1:10
result{i}=A(i:10:1000,:);
end

Plus de réponses (1)

Raj
Raj le 24 Mai 2019
A=rand(10000,10)
ii=1;
for jj=1:10
num=1;
for l=ii:10:10000
B(num,1:10)=A(l,1:10);
num=num+1;
end
C{jj}=B;
ii=ii+1;
end
  1 commentaire
madhan ravi
madhan ravi le 24 Mai 2019
Raj you could preallocate.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by