Vectorization of for loop
Afficher commentaires plus anciens
I have this for loop with conditionals inside it.
for i=1:m
for j=1:n
if (flipped_im(i,j,1)>flipped_im(i,j,2)) || (flipped_im(i,j,1)>flipped_im(i,j,3))
mod_im(i,j,:)=255;
else
mod_im(i,j,:)=flipped_im(i,j,:);
end
end
end
How I can turn this loop into vectorized code?
2 commentaires
Stephen23
le 14 Mar 2019
"How I can turn this loop into vectorized code?"
Why do you need to do that?
Yaser Alghawi
le 14 Mar 2019
Réponse acceptée
Plus de réponses (1)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!