How to calculate mean and standard deviation for loops?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Sumit Saha
il 11 Lug 2021
Commentato: Sumit Saha
il 11 Lug 2021
story_Acc_FN_UL0_S1_5 = randn(1,10);
story_Acc_FN_UL0_S2_5 = randn(1,10);
story_Acc_FN_UL0_S3_5 = randn(1,10);
story_Acc_FN_UL0_S4_5 = randn(1,10);
story_Acc_FN_UL0_S5_5 = randn(1,10);
for uu = 1:10
story_Acc_FN_UL0_R_rup_5(1,uu) = mean(story_Acc_FN_UL0_S1_5(1,uu),story_Acc_FN_UL0_S2_5(1,uu),story_Acc_FN_UL0_S3_5(1,uu),story_Acc_FN_UL0_S4_5(1,uu),story_Acc_FN_UL0_S5_5(1,uu));
std_dvt(1,uu) = std(story_Acc_FN_UL0_S1_5(1,uu),story_Acc_FN_UL0_S2_5(1,uu),story_Acc_FN_UL0_S3_5(1,uu),story_Acc_FN_UL0_S4_5(1,uu),story_Acc_FN_UL0_S5_5(1,uu));
end
0 Commenti
Risposta accettata
ANKUR KUMAR
il 11 Lug 2021
You don't need to use loop for that. You can use cat command to concatenate, and then use mean and std functions to the matrix itself.
story_Acc_FN_UL0_S1_5 = randn(1,10);
story_Acc_FN_UL0_S2_5 = randn(1,10);
story_Acc_FN_UL0_S3_5 = randn(1,10);
story_Acc_FN_UL0_S4_5 = randn(1,10);
story_Acc_FN_UL0_S5_5 = randn(1,10);
matrix=cat(1,story_Acc_FN_UL0_S1_5,story_Acc_FN_UL0_S2_5, story_Acc_FN_UL0_S3_5, story_Acc_FN_UL0_S4_5, story_Acc_FN_UL0_S5_5)
meanvalue=mean(matrix)
stdev=std(matrix)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!