Combine two cell arrays
    4 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
I have two cell arrays:
 X{1,1}=[18;21;17;20;19];
 X{1,2}=cellstr(['m';'f';'m';'m';'f']);
How to create new cell array like this:
 Z=[X{1,1}(:,:) X{1,2}(:,:)]
0 Kommentare
Akzeptierte Antwort
  Azzi Abdelmalek
      
      
 am 10 Aug. 2013
        
      Bearbeitet: Azzi Abdelmalek
      
      
 am 10 Aug. 2013
  
      Maybe you want
   X=[num2cell([18;21;17;20;19]) cellstr(['m';'f';'m';'m';'f'])]
0 Kommentare
Weitere Antworten (1)
  Andrei Bobrov
      
      
 am 10 Aug. 2013
        
      Bearbeitet: Andrei Bobrov
      
      
 am 10 Aug. 2013
  
      X{1,1}=num2str([18;21;17;20;19]);
X{1,2}=cellstr(['m';'f';'m';'m';'f']);
strcat(X{:})
OR
X{1,1}=num2cell([18;21;17;20;19]);
X{1,2}=cellstr(['m';'f';'m';'m';'f']);
[X{:}]
0 Kommentare
Siehe auch
Kategorien
				Mehr zu Data Types finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!