rectangle invisible in matlab

5 vues (au cours des 30 derniers jours)
Alan
Alan le 18 Août 2021
Commenté : Alan le 18 Août 2021
Hi all,
I draw a rectangular in a figure by the code,
roi = drawrectangle('color','r','linewidth',2);
And now I want to set the rectangular invisible, so I code like this:
H = findobj(handles, 'type','rectangle');
set(H,'visible','off');
But this code does not work at all.
Could anyone help me to figure it out?
Thanks so much.

Réponse acceptée

Turlough Hughes
Turlough Hughes le 18 Août 2021
The following works for me:
roi.Visible = 'off';
  2 commentaires
Turlough Hughes
Turlough Hughes le 18 Août 2021
similarly, you can use the object (already assigned to roi) with the set function as follows:
set(roi,'Visible','off')
Alan
Alan le 18 Août 2021
Thanks for your answer. It works well.

Connectez-vous pour commenter.

Plus de réponses (1)

Yongjian Feng
Yongjian Feng le 18 Août 2021
Try this:
H = findobj('Type', 'images.roi.rectangle');
  1 commentaire
Alan
Alan le 18 Août 2021
Thanks for your answer.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by