Mean automation from excel data
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Muhammad Usman Saleem
le 8 Avr 2016
can you add your sample excel file please? I want to check repeatition
Réponse acceptée
Andrei Bobrov
le 8 Avr 2016
ps = xlsread('yourdata.xlsx');
[speed,~,c] = unique(ps(:,2));
pressure_mean = accumarray(c,ps(:,1),[],@mean);
out = [pressure_mean, speed];
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!