Time series data in excel
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Fangjun Jiang
il 17 Nov 2011
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.
Risposte (1)
Fangjun Jiang
il 17 Nov 2011
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 Commenti
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!