Importing Matrix of mixed types into Matlab
Importing Matrix of mixed types into Matlab
(OP)
Hi, I'm new to the community.
I'm trying to import data from a tabulated data file, but the data contains both strings (rows 1 to 23) and a large number of floats (rows 24 and on). What I want to do is be able to load all of the floats (rows 24 and on) into Matlab while ignoring the rest, but I have no idea how to go about doing that. I've played with textscan and textread, but I haven't been able to figure it out. I would really appreciate anyone who could shine some light onto this for me.
I've attached a sample data file.
http: //files.en gineering. com/getfil e.aspx?fol der=02fadd 7e-9f01-4a b2-b3b2-c8 f40d6c34e1 &file= ppt04_puls e07_-_Copy
I'm trying to import data from a tabulated data file, but the data contains both strings (rows 1 to 23) and a large number of floats (rows 24 and on). What I want to do is be able to load all of the floats (rows 24 and on) into Matlab while ignoring the rest, but I have no idea how to go about doing that. I've played with textscan and textread, but I haven't been able to figure it out. I would really appreciate anyone who could shine some light onto this for me.
I've attached a sample data file.
http:





RE: Importing Matrix of mixed types into Matlab
[t,x,y,z] = textread('temp.txt','%f %f %f %f' ,'headerlines',23);
RE: Importing Matrix of mixed types into Matlab
It scans the both the header and data, any size in either, and outputs both in case you need it. Very robust little script.