How can I filter values >120 and <120

I want filter values in a matrix (A) where average value is 120, and I want convert values <120 in zeros and values >120 in ones. I write this code ... if true
A=[53 9 36 161 164 50;
149 60 162 173 51 3;
194 179 166 90 8 0;
192 196 150 46 7 0;
189 192 189 158 71 17;
183 182 192 190 179 137];
[m n]= size(A); for i=1:m; for j=1:n if(m>=120) B=zeros(m,n); else B=ones(m,n) end end end
end

Plus de réponses (0)

Catégories

En savoir plus sur Operators and Elementary Operations dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by