i am new to matlab .this is a text file and how to remove a lot of header files in dis text file and how to plot this data with respect to time versus height please inform me to understand my querstions
Show older comments
i am new to matlab .this is a text file and how to remove a lot of header files in dis text file and how to plot this data with respect to time versus height please inform me to understand my questions and at at lost i want a plot x-axis showing time and y-axis axis with respect to data
2 Comments
dpb
on 9 Apr 2014
You mean multiple header lines in a text file? Are they a fixed number or variable?
Look at the optional argument 'headerlines' in
doc textread
doc textscan
for starters, if so...
As for plotting, it all depends on what the data are -- just a x and y or a surface or what.
poshan reddy
on 11 Apr 2014
Edited: poshan reddy
on 11 Apr 2014
Accepted Answer
More Answers (1)
Image Analyst
on 11 Apr 2014
0 votes
You forgot to attach your data file. I suggest you use the readtable() function with the 'HeaderLines' option. (Requires R2013b or later.)
9 Comments
poshan reddy
on 11 Apr 2014
Image Analyst
on 11 Apr 2014
You have multiple data sets strung together
header
data
header
data
header
data
In that case you're going to have to scan down and parse lines. Use fopen, textscan, etc. Skip the header lines by searching for the first character of a line being numeric. Use isnumeric() for that. Then if it's a number, use textscan() to add it to an array, and then move to the next line. I'm pretty sure you can do it because it's not hard (I shouldn't need to do it for you after you look at the examples in the help), but if you have doubts or want me to look over your code, post it back here.
poshan reddy
on 26 Apr 2014
Image Analyst
on 27 Apr 2014
Look like you already have accepted an answer and got it working so it seems like I don't need to answer this anymore.
poshan reddy
on 28 Apr 2014
Image Analyst
on 28 Apr 2014
I assume you tried plot(x,y)??? And looked at xlim() and ylim()?
Well, attach your data file and the code that you have so far and perhaps someone will take a look at it.
poshan reddy
on 28 Apr 2014
Edited: poshan reddy
on 28 Apr 2014
Image Analyst
on 28 Apr 2014
Which of the 4 columns is the time?
poshan reddy
on 29 Apr 2014
Edited: poshan reddy
on 29 Apr 2014
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!