How can I turn a 1*1 cell into a cell array?
    조회 수: 8 (최근 30일)
  
       이전 댓글 표시
    
For example, what is the easiest way to turn a 1*1 cell 'a b c d e' into a cell array {'a'} {'b'} {'c'} {'d'} {'e'}? Please! Anyone can help me?
댓글 수: 0
채택된 답변
  Sameer
      
      
 2024년 8월 19일
        
      편집: Sameer
      
      
 2024년 8월 19일
  
      Hi
To split a 1x1 cell containing a string and convert the result into a cell array, you can utilize the "strsplit" function.
originalCell = {'a b c d e'};
splitArray = strsplit(originalCell{1});
disp(splitArray);
Hope this helps!
댓글 수: 3
  Walter Roberson
      
      
 2024년 8월 20일
				Another way:
originalCell = {'a b c d e'};
regexp(originalCell{1}, ' +', 'split')
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


