Filter löschen
Filter löschen

replacement of for loop in matlab

2 Ansichten (letzte 30 Tage)
Khawaja Asim
Khawaja Asim am 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....

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 15 Sep. 2011
img(img <= 25) = 255

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by