rectangle で描出した四角形を削除することができますか?

13 vues (au cours des 30 derniers jours)
Tsubasa Mawatari
Tsubasa Mawatari le 5 Sep 2018
rectangleで一度描出した四角形を削除することはできますか?

Réponse acceptée

mizuki
mizuki le 5 Sep 2018
はい、可能です。例えば以下のようなコードで四角形を描きます。
figure;
h = rectangle('Position',[1 2 5 6])
axis([0 10 0 10])
その後、rectangle のハンドル(図のプロパティと呼ばれる情報を保持しているオブジェクト)を delete 関数で消すことができます。
detele(h)
もし複数の四角形がある場合は、以下のように findobj for ループで消すことができます。
  1 commentaire
Tsubasa Mawatari
Tsubasa Mawatari le 6 Sep 2018
ありがとうございます。

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur ラベルと注釈 dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!