Time series data in excel
4 次查看(过去 30 天)
显示 更早的评论
Hi There, I have decided to use matlab instead of excel in order to make my data analysis life easier.
I have several excel files which have, for example, time (s) in column A and concentration in column B.
I've been able to import the excel file and create a plot for all the data (concentration vs time). What I need is to break up the plot into different time periods (100s,150,150....150).
For example: column A: 0-100s, 101-150s, 151-300s.. etc. and find the average concentration(column B) for that time period only so I can plot avg concentration per specified time interval.
Unfortunately it is not a simple matter of using the cell count because some data have been collected twice in 1 second, and sometimes, no data was collected for several seconds.
Any advice would be much appreciated.
Thanks in advance to all!!
Alizah
2 个评论
Fangjun Jiang
2011-11-17
So in that case, what is your algorithm to calculate the average? Are you asking for the algorithm, or are you asking how to implement the algorithm, which you didn't disclose.
回答(1 个)
Fangjun Jiang
2011-11-17
Okay, maybe this is what you need.
1. You may want to get rid of the duplicated time and its data.
A=[1 0.1;1 0.2;2 0.3;2 0.4;3 0.5]
[trash,ind]=unique(A(:,1));
A=A(ind,:)
2. You can use logic indexing to pick out the data that meets your time criteria.
A=[(0:20)',rand(21,1)]
ind=and(5<A,A<15);
A=A(ind,:)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!