Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Matrix of mixed types into Matlab

Status
Not open for further replies.

jwbrooks

Aerospace
Joined
Dec 7, 2010
Messages
1
Location
US
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.




 
Try this

[t,x,y,z] = textread('temp.txt','%f %f %f %f' ,'headerlines',23);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top