Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How do I define more than one matrix as i= on for loop?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have these 3 loops:
for i = jumph
SJvsSJWA = ttest2(i(ref(:,3)),i(ref(:,1)));% jump height
CJvsCJWA = ttest2(i(ref(:,4)),i(ref(:,2)));
SJWAvsCJWA = ttest2(i(ref(:,1)),i(ref(:,2)));
SJvsCJ = ttest2(i(ref(:,3)),i(ref(:,4)));
end
for i = avp
SJvsSJWA = ttest2(i(ref(:,3)),i(ref(:,1)));% average power
CJvsCJWA = ttest2(i(ref(:,4)),i(ref(:,2)));
SJWAvsCJWA = ttest2(i(ref(:,1)),i(ref(:,2)));
SJvsCJ = ttest2(i(ref(:,3)),i(ref(:,4)));
end
for i = peakp
SJvsSJWA = ttest2(i(ref(:,3)),i(ref(:,1)));% peak power
CJvsCJWA = ttest2(i(ref(:,4)),i(ref(:,2)));
SJWAvsCJWA = ttest2(i(ref(:,1)),i(ref(:,2)));
SJvsCJ = ttest2(i(ref(:,3)),i(ref(:,4)));
end
What I want to do is combine the 3 for loops so that for example:
i = jumph:avp:peakp
but I am aware this wouldn't work, so need a way to do this.
The three variables jumph, avp and peakp are all 54 x 1 matrices.
3 comentarios
Star Strider
el 19 de Mayo de 2014
Is ‘i’ a loop counter (vector) or is it something else? (This may have a context I’m not familiar with.) I don’t know how your data are organised.
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!