Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Marty
Posts:
1
Registered:
3/19/14


Problems with textscan reading formatted text
Posted:
Mar 19, 2014 5:57 PM


I am trying to use textscan to read the following line from a textfile where I only want a subset of the text. The file looks like:
header line header line 1 pixel = 0.0106 Lens information can be found in Charlotte's lab notebook: book 1 page 15. other data
I want to store the numbers 1 and 15 from line 4.
My code is:
filepath='140304_1_C.txt'; fid=fopen(filepath,'r'); textscan(fid,'%s',2,'delimiter','\n'); pixelsize = textscan(fid,'1 pix = %7.5f %*[^\n]'); info = textscan(fid,'Lens information can be found in Charlotte''s lab notebook book: %f %s %f %*[^\n]');
This is not working. info returns [] [] [].
I am a novice with Matlab. Any help with this is much appreciated.


Date

Subject

Author

3/19/14


Marty

3/19/14


dpb


