how can I get the mean of GeneralCycle?
1 回表示 (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (1 件)
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:
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!