Accessing data in a cell array
    6 ビュー (過去 30 日間)
  
       古いコメントを表示
    
Hello, I have a (1x7) cell array that contains as follows:
cell_array = 
Columns 1 through 4
      [10000x8 char]    [10000x6 char]    [10000x6 char]    [10000x1 double]
Columns 5 through 7
      [10000x64 char]    [10000x10 char]    [10000x1 int]
I want to access some part of cell_array, i.e. the 100 line of data in cell_array from row 2101 to row 2200. Would you please help me how to refer those elements of cell_array?
Thanks a lot!
2 件のコメント
回答 (1 件)
  Jeffrey Girard
      
 2015 年 4 月 8 日
        Hopefully this will give you some clues:
c = cell(1,2);
c{1} = ['abcd';'efgh'];
c{2} = [1,2,3,4;5,6,7,8];
c = 
      [2x4 char]    [2x4 double]
string = c{1}(2,2:3)
string =
fg
number = c{2}(1:2,3:4)
number =
       3     4
       7     8
2 件のコメント
  Jeffrey Girard
      
 2015 年 4 月 8 日
				
      編集済み: Jeffrey Girard
      
 2015 年 4 月 8 日
  
			MATLAB really wants you to keep strings and numbers separate. Your options are to convert the numbers to strings (e.g., num2str() ) or write them both to cells.
参考
カテゴリ
				Help Center および File Exchange で Matrix Indexing についてさらに検索
			
	製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


