Main Content

이 페이지는 기계 번역을 사용하여 번역되었습니다. 영어 원문을 보려면 여기를 클릭하십시오.

Advisor.authoring.createBlockConstraintCheck

블록 제약 조건을 사용하여 Model Advisor 검사 만들기

설명

예제

check_obj = Advisor.authoring.createBlockConstraintCheck(check_ID,'Constraints',@handle)ModelAdvisor.check 객체인 check_obj를 생성하고 여기에 check_ID 식별자를 할당하고 제약 조건 생성 함수 @handle에서 블록 제약 조건을 지정합니다.

check_obj = Advisor.authoring.createBlockConstraintCheck(check_ID)ModelAdvisor.check 객체인 check_obj를 생성하고 여기에 check_ID 식별자를 할당합니다. Advisor.authoring.generateBlockConstraintsDataFile 함수를 사용하여 블록 제약 조건 데이터 파일을 생성합니다. setInputParameters 함수를 사용하여 블록 제약 조건 데이터 파일을 ModelAdvisor.check 객체에 대한 입력 매개변수로 지정합니다. 자세한 내용은 Advisor.authoring.generateBlockConstraintsDataFile를 참조하세요.

참고

Advisor.authoring.createBlockConstraintCheck에 의해 생성된 ModelAdvisor.Check 개체는 제외 설정을 지원하지 않습니다.

예제

모두 축소

이 예에서는 Model Advisor 제약 조건 검사를 지정하고 등록하는 방법을 보여줍니다. newCheck 함수에서 Advisor.authoring.createBlockConstraintCheck 함수는 createConstraints 함수에 의해 생성된 제약 조건을 사용하여 ModelAdvisor.check 객체 rec를 생성합니다.

function newCheck()

    rec = Advisor.authoring.createBlockConstraintCheck(...
    'mathworks.check_0001',...
    'Constraints',@createConstraints);

    rec.Title = 'Example1: Check block parameter constraints';
    rec.TitleTips = 'Example check block parameter constraints';

    mdladvRoot = ModelAdvisor.Root;
    mdladvRoot.register(rec);

 
end

function constraints = createConstraints()

    c1=Advisor.authoring.PositiveBlockParameterConstraint;
    c1.ID='ID_1';
    c1.BlockType='Constant';
    c1.ParameterName='Value';
    c1.SupportedParameterValues={'1'};
    c1.ValueOperator='eq';

    c2=Advisor.authoring.PositiveBlockParameterConstraint;
    c2.ID='ID_2';
    c2.BlockType='Gain';
    c2.ParameterName='Gain';
    c2.SupportedParameterValues={'1'};
    c2.ValueOperator='gt';

    constraints = {c1,c2};

end

입력 인수

모두 축소

모델 권고자 검사 이름으로, 문자형 벡터로 지정됩니다.

예: 'com.mathworks.sample.Check1'

제약 조건 생성 함수로, 함수 핸들로 지정됩니다.

예: @createConstraints

출력 인수

모두 축소

ModelAdvisor.check 객체로 반환된 Model Advisor 확인

버전 내역

R2018a에 개발됨