필터 지우기
필터 지우기

how can I get the mean of GeneralCycle?

조회 수: 2 (최근 30일)
hammad albusalih
hammad albusalih 2022년 5월 9일
답변: Bhanu Prakash 2023년 10월 20일
figure;
for k=1:TotalPath
myFind = find(RFHindpos >= xRounded(1,k) & RFHindpos <= xRounded(2,k));%numbers of RHS inside paths
GeneralCycle = (RFHindpos(myFind(1:end))); % the exact point of the RHS
hold all;
for t=1:length(myFind)-1
plot(Rkneeflex(GeneralCycle(t):GeneralCycle(t+1))); % the points where cycles start and end
sgtitle('Gait Cycles')
% plot(meanofcycCellarray)
end
GeneralCycleCellArray{k}=GeneralCycle; % where you store all generalcycles so you dont loose them after each loop
meanofcyc = [t;(Rkneeflex(GeneralCycle(k):GeneralCycle(k+1)))];
plot(meanofcyc,'g')
end

답변 (1개)

Bhanu Prakash
Bhanu Prakash 2023년 10월 20일
Hi Hammad,
I understand that you want to calculate the mean of the ‘GeneralCycle’ array.
To calculate the mean of an array, you can use the ‘mean’ function in MATLAB as shown in the edited part of the code below:
GeneralCycleCellArray{k} = GeneralCycle;
% Calculate the mean of GeneralCycle
meanofcyc = mean(GeneralCycle);
% Store the mean value in the cell array
meanofcycCellArray{k} = meanofcyc;
plot(meanofcyc, 'g');
The above code calculates the mean of the GeneralCycle and stores it in a cell array ‘meanofcycCellArray’. You can plot the mean using the plot function.
For more information on the ‘mean’ function, refer to the following documentation:

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by