replacement of for loop in matlab

1 vue (au cours des 30 derniers jours)
Khawaja Asim
Khawaja Asim le 15 Sep 2011
for i=1:size(img,1)
for j=1:size(img,2)
if img(i,j)<=25
img(i,j)=255;
end
end
end
can anyone please tell me about the replacement of this piece of code in just one line..? I know it can be replaced with one line, but i am not able to it correctly....

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 15 Sep 2011
img(img <= 25) = 255
  1 commentaire
Khawaja Asim
Khawaja Asim le 15 Sep 2011
thanku dear... :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by