calculate std and mean for multiple variables automated

8 ビュー (過去 30 日間)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 9 月 5 日
回答済み: Catalytic 2019 年 9 月 5 日
I have many variables that need to calculate std and mean for them. Is there any structure (other than defining a function) that can do this calculation for all determined variables instead of writing mean() and std() for each individual variable?
  1 件のコメント
Rik
Rik 2019 年 9 月 5 日
Are your variables fields of a struct?

サインインしてコメントする。

回答 (1 件)

Catalytic
Catalytic 2019 年 9 月 5 日
Observe -
>> input=rand(10,5)
input =
0.8147 0.1576 0.6557 0.7060 0.4387
0.9058 0.9706 0.0357 0.0318 0.3816
0.1270 0.9572 0.8491 0.2769 0.7655
0.9134 0.4854 0.9340 0.0462 0.7952
0.6324 0.8003 0.6787 0.0971 0.1869
0.0975 0.1419 0.7577 0.8235 0.4898
0.2785 0.4218 0.7431 0.6948 0.4456
0.5469 0.9157 0.3922 0.3171 0.6463
0.9575 0.7922 0.6555 0.9502 0.7094
0.9649 0.9595 0.1712 0.0344 0.7547
>> std(input)
ans =
0.3459 0.3308 0.2935 0.3607 0.2025

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by