How to calculate mean and standard deviation for loops?
10 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
ANKUR KUMAR
2021 年 7 月 11 日
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)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!