textscan - import the k-th out of n columns and ingore the 1st row which contains column names
    3 ビュー (過去 30 日間)
  
       古いコメントを表示
    
    Nikolaos Gkiouzelis
 2022 年 9 月 20 日
  
    
    
    
    
    回答済み: Walter Roberson
      
      
 2022 年 9 月 20 日
            My txt file contains more than 100 columns and rows. How can I save any column avoiding the following 
Mydata = textscan(fid,'%f %f %f %f %f ... %f','HeaderLines',1);  %   %f as many as the number of columns
If any line/function is more efficient for my case please recommend it.
Thank you in advance.
0 件のコメント
採用された回答
  Walter Roberson
      
      
 2022 年 9 月 20 日
        cols_to_keep = [17, 83:85];   %for example
fmt = repmat({'%*f'}, 1, NumberOfColumns);  %read but do not sae
fmt(cols_to_keep) = {'%f'};    %read and save
fmt = [fmt{:}];
MyData = textscan(fid, fmt, 'HeaderLines', 1);
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Spreadsheets についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

