replacement of for loop in matlab

2 次查看(过去 30 天)
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....

采纳的回答

Andrei Bobrov
Andrei Bobrov 2011-9-15
img(img <= 25) = 255

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by