Mean automation from excel data
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Yogesh T L
il 8 Apr 2016
Commentato: Yogesh T L
il 8 Apr 2016
Hi, Let's say we have the following data, and I would like to obtain the mean of pressure for speed 20 only. Then I am also interested to obtain mean for speeds 40 only, 60 only... I am using excel for this but matlab would be a better option for automation from my opinion as the data is huge.Thank you.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160500/image.png)
2 Commenti
Muhammad Usman Saleem
il 8 Apr 2016
can you add your sample excel file please? I want to check repeatition
Risposta accettata
Andrei Bobrov
il 8 Apr 2016
ps = xlsread('yourdata.xlsx');
[speed,~,c] = unique(ps(:,2));
pressure_mean = accumarray(c,ps(:,1),[],@mean);
out = [pressure_mean, speed];
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!