Vectorization of for loop
Mostrar comentarios más antiguos
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 comentarios
Stephen23
el 14 de Mzo. de 2019
"How I can turn this loop into vectorized code?"
Why do you need to do that?
Yaser Alghawi
el 14 de Mzo. de 2019
Respuesta aceptada
Más respuestas (1)
Yaser Alghawi
el 14 de Mzo. de 2019
0 votos
1 comentario
Stephen23
el 14 de Mzo. de 2019
Who is Chris?
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!