Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.42 KB | None | 0 0
  1. fid = fopen(['C:\Users\Benjamin\Documents\Precip_Data\Hurricanes\'...
  2. 'HurData2005.txt'],'r') ;
  3.  
  4. S = textscan(fid,'%s','delimiter','\n') ;
  5. %S{?} finds header, idx finds all the title line locations,
  6. S = S{1} ;
  7. fclose(fid) ;
  8. idx = find(contains(S,'AL')) ;
  9.  
  10. %iwant{?} reads lines under that
  11. iwant = cell(length(idx),1) ;
  12. for i = 1:length(idx)-1
  13.     iwant{i} = S(idx(i)+1:idx(i+1)-1) ;
  14. end
  15. iwant{end} = S(idx(end)+1:end) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement