Group making from large data size

조회 수: 1 (최근 30일)
Ismita
Ismita 2022년 4월 21일
답변: Image Analyst 2022년 4월 21일
How to make group of 10 row and mean of those 10 rows, then to calculate fluctuation of each gruop member from their corresponding mean, variance of each group.
suppose :
%data resolution 1 min; so 10 row indicates 10 minute ; we can observe those properties for each 10 min in this case
All_data = rand(100,3); %100 row and 3 column
time_min = All_data(:,1); % column 1
Vx = All_data(:,2); %column 2
Now I need to
  1. make group of 10 data
  2. mean of those 10 data
  3. fluctuation = Vx(i) - mean(Vx(for each group)) % within that group
  4. variance of that group

답변 (2개)

David Hill
David Hill 2022년 4월 21일
a=rand(100,3);
b=zeros(10,3,10);
for k=1:10
b(:,:,k)=a(10*(k-1)+1:10*k,:);%10 groups
end
%not sure what you want for mean, fluctuation, or variance. You will need
%to explain further.

Image Analyst
Image Analyst 2022년 4월 21일
Sounds like homework. Hints:
groupNumbers = repelem(1:10, 10);
Now use either splitapply(), groupsummary(), or grpstats() to get the stats on the 10 groups separately.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by