Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to calculate the mean of an image if I want to delete some value?

1 回表示 (過去 30 日間)
Ajaree Rattanaharn
Ajaree Rattanaharn 2019 年 1 月 17 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
value.png
the picture above show the value of my picture
I don't know how to calculate the mean of all value if I don't want the value that >185
I must use what code?
Help me please TT

回答 (1 件)

madhan ravi
madhan ravi 2019 年 1 月 17 日
編集済み: madhan ravi 2019 年 1 月 17 日
matrix=double(matrix); % where matrix is the matrix of which you are trying to calculate the mean of
matrix(matrix>185)=NaN;
Result=mean(matrix(:),'omitnan') % mean along all dimensions
result=mean(a,1,'omitnan') % mean along columns
result=mean(a,2,'omitnan') % mean along rows
result(~isnan(result)) % to omit NaN values from the result
  2 件のコメント
Ajaree Rattanaharn
Ajaree Rattanaharn 2019 年 1 月 17 日
Thank for your comment ^^
I got it ^^
madhan ravi
madhan ravi 2019 年 1 月 17 日
編集済み: madhan ravi 2019 年 1 月 17 日
Anytime :) , if it was what you were looking for make sure to accept the answer.

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by