Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. [fid, message]=fopen('info1.txt','r');
  2. x=fread(fid,'char=>char');
  3. %skip the 9 first lines of the file
  4. for i=1:9
  5. fgetl(fid);
  6. end
  7. tline = fgets(fid);
  8. s=[];
  9. j=1;
  10. while ischar(tline)
  11. disp(tline);
  12. tline = fgetl(fid); %read line by line
  13. i=1;
  14. while double(tline(i))~=13
  15. if(tline(i)==':')
  16. while tline(i+1)~=' '
  17. s(j)=s(j)+tline(i+1);
  18. end
  19. else i=i+1;
  20. end
  21. end
  22. j=j+1;
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement