Effacer les filtres
Effacer les filtres

How to store data in double for-loop?

2 vues (au cours des 30 derniers jours)
Sam
Sam le 20 Déc 2014
Modifié(e) : Image Analyst le 20 Déc 2014
I have created a double for-loop. The outer one is for 5 subjects. The inner loop is for 3 measurements.
for welke_pp = 1 : aantal_pp
switch welke_pp
case 1
case 2
case 3
case 4
case 5
end
for i_testen = 1 : length(data_stair_rise)
% to calculate 'Heup_hoek', 'Heup_hoek_afg' and 'Gemiddelde_gewrichtshoek'
Heup_hoek = data_sts(welke_pp,i_testen).VideoSignals(:, strcmp('RHipAngles', data_sts(welke_pp,i_testen).VideoSignals_headers));
Heup_hoek_afg{i_testen} = Heup_hoek(1:Afg_c_RASI(2,1));
% I can store 'Gemiddelde_gewrichtshoek' for 3 measurements (=i_testen).
Gemiddelde_gewrichtshoek.Heuphoek.meting(i_testen) = mean(Heup_hoek_afg{1, (i_testen)});
end
end
How can I store the 3 measurements for EACH subject, and not for only 1 subject?

Réponse acceptée

Image Analyst
Image Analyst le 20 Déc 2014
Use two indices:
Gemiddelde_gewrichtshoek.Heuphoek.meting(i_testen, welke_pp) = ...

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by