Problem with the mean function

2 ビュー (過去 30 日間)
shalat sunny n
shalat sunny n 2016 年 3 月 9 日
コメント済み: shalat sunny n 2016 年 3 月 9 日
hiiii, I want to calculate the mean value for the frames which are extracted from a video .I use mean=mean(X) but there is some error has been occured.so can you please suggest me the answer for calculating the mean value of extracted frames.

採用された回答

Walter Roberson
Walter Roberson 2016 年 3 月 9 日
When you did
mean = mean(X)
that will work the first time, calculating the mean and storing the result in the variable named "mean".
But the second time you ask to execute it, mean(X) does not refer to the function mean, it refers to the variable "mean" that you assigned the calculation to.
Solution: never use a variable name which is the same as the name of a function you might want to call, because as soon as you do the assignment, the name stops referring to the function and starts referring to the variable.
  1 件のコメント
shalat sunny n
shalat sunny n 2016 年 3 月 9 日
thank you so much for answering my question.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by