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!