Borrar filtros
Borrar filtros

replacement of for loop in matlab

2 visualizaciones (últimos 30 días)
Khawaja Asim
Khawaja Asim el 15 de Sept. de 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....

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 15 de Sept. de 2011
img(img <= 25) = 255

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by