Info
此问题已关闭。 请重新打开它进行编辑或回答。
How to calculate the mean of an image if I want to delete some value?
1 次查看(过去 30 天)
显示 更早的评论
![value.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/144580/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
0 个评论
回答(1 个)
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 个评论
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!