필터 지우기
필터 지우기

computation for each date

조회 수: 1 (최근 30일)
Gokturk
Gokturk 2012년 12월 15일
Sorry for this presumably simple question, but i am new in coding. I want matlab to make a computation for specific dates but it does not read dates from the excel file. To give a simple example, lets say we have different observations for each date (number of observations is changing date to date) and on excel: first column for dates and second is for observations. I want matlab to read first column, and get the observations for each date separately and lets say take average of the observations, that is showing daily average, sum all observations for each date and divide number of obs (length of obs vector) Thanks a lot for your help
[EDITED, Jan, copied from Answer section, but this is an important part of the question]
Hi, thanks for the replies, but I gave taking averages as an example, my problem in here is, how to get data from xls depending on specific dates I do have a sheet like;
date1 12314 03123
date1 11321 84646
date2 46469 4580
.. 46461 4667
daten 78974 8795
(first column is for date second and third..for data)
and I want to get data assigned to each date (colums right next to dates) separately so that I can make some computations on them. I searched and found that I can get data by datenum, and transfer it to matlab date, thats fine. But I could not figure out how I can split data according to the dates :(
  댓글 수: 1
bym
bym 2012년 12월 15일
what have you done so far? I suggest you look into
accumarray()

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

답변 (1개)

Mark Whirdy
Mark Whirdy 2012년 12월 16일
doc xlsread
doc movavg
doc accumarray
  댓글 수: 1
Gokturk
Gokturk 2013년 1월 23일
the main question was how to deal with importing such a data on dates and make some computations on the data assigned to specific dates. lets say for some certain dates take the vector corresponding to that date and do whatever..i managed to handle the problem by getting the data as excel date numbers transferred into matlab date numbers, did the rest according to the number array rather than string cells.

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

카테고리

Help CenterFile Exchange에서 Time Series Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by