Mean automation from excel data
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Muhammad Usman Saleem
2016년 4월 8일
can you add your sample excel file please? I want to check repeatition
채택된 답변
Andrei Bobrov
2016년 4월 8일
ps = xlsread('yourdata.xlsx');
[speed,~,c] = unique(ps(:,2));
pressure_mean = accumarray(c,ps(:,1),[],@mean);
out = [pressure_mean, speed];
댓글 수: 0
추가 답변 (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!