필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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
dpb
dpb 2014년 4월 9일
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
poshan reddy 2014년 4월 11일
편집: poshan reddy 2014년 4월 11일
multiple header lines in a text file. and that too i have to plot in x,y and z dimensions.time in x-axis

댓글을 달려면 로그인하십시오.

채택된 답변

dpb
dpb 2014년 4월 26일
SOTOO...
c=[]; % an empty array to collect data into
fmt=repmat('%f',1,4); % format string for the numeric data 4/record
fid=fopen('31oct97.txt','r'); % open the file, return file handle
while ~feof(fid) % begin loop until run out of data in file
c=[c;cell2mat(textscan(fid,fmt,187,'headerlines',24))]; % read a chunk/concat onto previous
end
NB: aircode, not tested but basic idea...salt to suit.
  댓글 수: 1
poshan reddy
poshan reddy 2014년 4월 27일
편집: poshan reddy 2014년 4월 28일
thank u sir for ur help .how can i plot this in time series....and also in this data was also gone some what .now in this file timings are differeent how can i plot with exact timings on x-axis and height on y-axis and data u changing with respect to time in the same way time v,w also please give a program

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2014년 4월 11일
You forgot to attach your data file. I suggest you use the readtable() function with the 'HeaderLines' option. (Requires R2013b or later.)
  댓글 수: 9
poshan reddy
poshan reddy 2014년 4월 29일
편집: poshan reddy 2014년 4월 29일
in the above text file there is a time and date and u is changing with respect to time because it has has four headers sir .check it out

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by