i have a matrix which entries are randperm function i have a for loop for generating this matrix i want save all the matrix that generate in the loop while it can save 1 matrix in workspace can u help me for the save all of matrix?
this is my code:
for p=1:pop
s1={'courses','days&times','class','pro';'physic1',randperm(20,2),randperm(5,2),'poury';'math1',randperm(20,2),randperm(5,2),'saadat';
'compbs',randperm(20,2),randperm(5,2),'azyzy';'physic1Lab',randperm(20,2),randperm(5,2),'mahlooji';
'compLab',randperm(20,2),randperm(5,2),'alavy';'English',randperm(20,2),randperm(5,2),'tabary'}
p+1;
end

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 16 Okt. 2013
Bearbeitet: Azzi Abdelmalek am 16 Okt. 2013

0 Stimmen

for p=1:10
s1{p}={'courses','days×','class','pro';
'physic1',randperm(20,2),randperm(5,2),'poury';
'math1',randperm(20,2),randperm(5,2),'saadat';
'compbs',randperm(20,2),randperm(5,2),'azyzy';
'physic1Lab',randperm(20,2),randperm(5,2),'mahlooji';
'compLab',randperm(20,2),randperm(5,2),'alavy';
'English',randperm(20,2),randperm(5,2),'tabary'}
end

4 Kommentare

fatemeh
fatemeh am 16 Okt. 2013
no it dosnt work! its result is: s1 =
{7x4 cell} {7x4 cell } 'class' 'pro'
{7x4 cell} {7x4 cell } [1x2 double] 'poury'
{7x4 cell} [1x2 double] [1x2 double] 'saadat'
{7x4 cell} [1x2 double] [1x2 double] 'azyzy'
{7x4 cell} [1x2 double] [1x2 double] 'mahlooji'
{7x4 cell} [1x2 double] [1x2 double] 'alavy'
{7x4 cell} [1x2 double] [1x2 double] 'tabary'
fatemeh
fatemeh am 16 Okt. 2013
i dont understand this result,each cell of s1 give s1!but only some of cells give this result as u see...
clear s1
then try again
fatemeh
fatemeh am 16 Okt. 2013
thanks,this is work!u are kindly!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Community Treasure Hunt

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

Start Hunting!

Translated by