http://www.mathworks.com/help/matlab/ref/textscan.html

Basically I am looking for something that does the opposite of the @printf 
macro...i.e., it reads in lines from a text file that has a specific format 
specifier. readdlm does not seem to do what I want (or maybe I'm not using 
it properly). As a specific example, say I have a file that is in a 
"bedgraph" format (.bed) that would look something like this:

chr1 1 4 1.5
chr1 6 10 2.7
chr2 70 230 6.4

I would like to specify that the file is formatted as "chr%u %u %u %f" and 
to receive four vectors (3 Ints and 1 Float):

[1,1,2]
[1,6,70]
[4,10,230]
[1.5,2.7,6.4]

Does anyone know of a function that has this feature? If not, is there an 
easy way to do this with existing functions/macros?

Thanks!
Garrett

P.S. Sorry if this is a duplicate, my previous post didn't seem to go 
through.

Reply via email to