Formatting Sea Level Data

조회 수: 6 (최근 30일)
Edu PL
Edu PL 2013년 10월 30일
댓글: Erin 2026년 1월 30일 21:18
Hello to everyone,
I am pretty new with Matlab and I dont know how to get this right. I am trying to process some data carrying sea level information. The file contains 17858 lines where each line corresponds to half day of sea level measurements; this is the first line of the pack:
200901011 2199 2096 1923 1777 1679 1650 1697 1796 1907 2007 2065 2073
where the first number of each line (ie 200901011) represents "year-month-day-halfday" and the rest of the numbers are sea level measurements in mm for every hour during the halfday itself. I am attaching one mat file to clarify.
I would like to process the data being able to plot time vs. sea level but I don't know how to extract the different variables and get the proper time series, particularly when it comes to join the data corresponding to the same day (halfday+halfday). Maybe it is simple and straightforward but this is when you know the bussines...
Thanks very much in advance!
Edu
  댓글 수: 1
Erin
Erin 2026년 1월 30일 21:16
hi!
I am sea level expert, not saying c-level, lol.
No i am serious, if you want to know as much as I know, please subscribe and leave a like!
Y'all!

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

채택된 답변

Mischa Kim
Mischa Kim 2014년 2월 16일
편집: Mischa Kim 2014년 2월 16일
Edu, this should do:
ndays = length(data(:,1))/2;
ndata = ndays*24;
Tdata = data(:,1);
Rdata = reshape(data(:,2:end)',ndata,[]); % turn data into a singular column vector
tloc = 12*find((Tdata - 1e3*round(Tdata/1e3)) == 11); % find 1st of month for tick labeling
tlab = {'Jan','Feb','Mar','Apr','May','Jun',...
'Jul','Aug','Sep','Oct','Nov','Dec'}; % corresponding tick labels
tspan = 1:ndata;
plot(tspan,Rdata,'+-b')
xlabel('Month')
ylabel('[your ylabel]')
title('[your title]')
grid;
set(gca,'XTick',tloc,'XTickLabel',tlab)
  댓글 수: 2
Edu PL
Edu PL 2014년 2월 25일
Hi Mischa. Yes it is exactly the routine I was looking for. Thanks very much! (by the way what if I have more than 1 year of data? how can I make a difference in the x axis?)
Thanks for the time and effort put on this and sorry to get back to you a bit late.
Regards!!
Edu
Erin
Erin 2026년 1월 30일 21:18
Hi Mischa,
just saying, what year u living in??
Just use chatgpt, why does this forum even exist?
just saying y'allll

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Weather and Atmospheric Science에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by