Borrar filtros
Borrar filtros

how can I get the mean of GeneralCycle?

2 visualizaciones (últimos 30 días)
hammad albusalih
hammad albusalih el 9 de Mayo de 2022
Respondida: Bhanu Prakash el 20 de Oct. de 2023
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

Respuestas (1)

Bhanu Prakash
Bhanu Prakash el 20 de Oct. de 2023
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:

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by