주요 콘텐츠

delete

구문

설명

delete(a)는 지정된 주석을 삭제합니다.

예제

예제

모두 축소

이 예제에서는 프로그래밍 방식으로 vdp 모델에서 주석을 삭제하는 방법을 보여줍니다.

예제를 엽니다. 그런 다음 vdp 모델을 엽니다.

open_system('vdp')

At the top of the Van der Pol Equation model is an annotation with the text "Van der Pol Equation". Underneath is a second annotation displaying the equation.

모델에 있는 주석에 대한 핸들을 가져오기 위해 find_system 함수를 사용합니다.

h = find_system(gcs,'FindAll','on','Type','annotation');

주석을 식별하기 위해 주석 내에 있는 텍스트를 쿼리합니다.

get_param(h,'PlainText')
ans = 3×1 cell
    {'Copyright 2004-2024 The MathWorks, Inc.'}
    {'Van der Pol Equation'                   }
    {'x_1' =x_2↵↵x_2' =µ(1-x_1^2) x_2 - x_1'  }

모델 'Van der Pol Equation'의 상단에 있는 주석을 삭제하기 위해 두 번째 핸들에 대응하는 Simulink.Annotation 객체를 가져옵니다.

an = get_param(h(2),'Object');

모델에서 주석을 삭제합니다.

delete(an)

Van der Pol Equation model without the annotation at the top that says "Van der Pol Equation"

모델에 있는 주석에 대한 핸들을 가져옵니다. 그런 다음 주석 내에 있는 텍스트를 쿼리합니다.

h1 = find_system(gcs,'FindAll','on','Type','annotation');
get_param(h1,'PlainText')
ans = 2×1 cell
    {'Copyright 2004-2024 The MathWorks, Inc.'}
    {'x_1' =x_2↵↵x_2' =µ(1-x_1^2) x_2 - x_1'  }

모델에 더 이상 'Van der Pol Equation'이라는 텍스트를 가진 주석이 없습니다.

입력 인수

모두 축소

주석으로, Simulink.Annotation 객체로 지정됩니다.

버전 내역

R2006a 이전에 개발됨