Matlab code without for loop
显示 更早的评论
Image contains 4 pixels . 0-background, 1,2 and 3 freground pixels.Can anyone help me how to improve the following code for computational efficiency? Thanks
[m n]=size(image);
for p=1:m
for q=1:n
if image(p,q)==1
image(p,q)=255;
else
image(p,q)=0;
end
end
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Signal Processing Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!