Finding the mean of my entire data

6 ビュー (過去 30 日間)
Megan Mirkhanian
Megan Mirkhanian 2018 年 11 月 28 日
回答済み: Star Strider 2018 年 11 月 28 日
How do I find the entire mean of all my data points
  1 件のコメント
Luna
Luna 2018 年 11 月 28 日
Could you please be more specific about what you needed and how is your data structure?

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

回答 (3 件)

Megan Mirkhanian
Megan Mirkhanian 2018 年 11 月 28 日
Yes, my data has a bunch of rows and columns and I want to find the mean of all the datapoints. I keep using mean(file_name) but I dont think that is teh correct mean.

Luna
Luna 2018 年 11 月 28 日
編集済み: Luna 2018 年 11 月 28 日
You can not put file name into mean function.
Please put variable name which exist in your workspace after loading your data.
mean(variableName)
You haven't included your workspace in that screenshot so I don't see anything.
for example create a 5x5 matrix A and take mean value. Mean works with columns.
A = magic(5)
mean(A)

Star Strider
Star Strider 2018 年 11 月 28 日
If you have R2018b, use the 'all' argument:
Avg = mean(MyMatrix, 'all')
otherwise, convert it to a column vector and take the mean of that:
Avg = mean(MyMatrix(:))

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by