Meet multiple conditions (or)

12 visualizaciones (últimos 30 días)
MARIA RODRIGUEZ SANZ
MARIA RODRIGUEZ SANZ el 4 de Jul. de 2019
Comentada: MARIA RODRIGUEZ SANZ el 4 de Jul. de 2019
Hi!
I wold like to show the objects of an image meeting a condition:
imshow(peroxi_3d_lab==condition)
This condition can be x, or y, or z or....
imshow(peroxi_3d_lab==1 | peroxi_3d_lab==3 | peroxi_3d_lab==10)....
Do I need to specify every condition? This would be bothering because I have many conditions (and different) for every image...and lots of images...
imshow(peroxi_3d_lab==[my_condition_array])
???
Thanks in advanced!

Respuesta aceptada

Stephen23
Stephen23 el 4 de Jul. de 2019
Editada: Stephen23 el 4 de Jul. de 2019
ismember(peroxi_3d_lab,your_conditions_array)
Tip: with MATLAB it is always important to think in terms of operating on arrays: putting all of the conditions into one array makes it easier to use MATLAB.
  1 comentario
MARIA RODRIGUEZ SANZ
MARIA RODRIGUEZ SANZ el 4 de Jul. de 2019
Got it!
imshow(max( ismember(peroxi_3d_lab,masd1),[],3))
Thanks a lot! :D :D :D

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical 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