Main Content

이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.

상태 및 천이 구문

동작 및 조건을 사용하여 차트 작동 방식 표현

상태 간 천이가 발생하는 시점과 동작이 실행되는 시점을 지정하여 Stateflow® 차트의 실행을 제어합니다. 이벤트를 브로드캐스트하여 상태 실행을 동기화합니다. 데이터 값에서 변경을 감지하고 차트 실행 중에 어느 상태가 활성 상태인지 검사합니다.

블록

모두 확장

Chart유한 상태 머신으로 제어 논리 구현
State Transition Table테이블 형식으로 모달 논리 표현
Truth Table조건, 결정, 동작으로 의사 결정 로직 표현

Stateflow 구문

모두 확장

변경 감지

hasChangedDetect change in data since last time step in Stateflow chart
hasChangedFromDetect change in data from specified value in Stateflow chart
hasChangedToDetect change in data to specified value in Stateflow chart
change데이터 값 변경 시 묵시적 이벤트 생성

경계 검출

crossing마지막 시간 스텝 이후 데이터의 상승 또는 하강 에지 감지
falling마지막 시간 스텝 이후 데이터의 하강 에지 감지
rising마지막 시간 스텝 이후 데이터의 상승 에지 감지

메시지 활동

send메시지 또는 이벤트 브로드캐스트
receiveExtract message from queue
discardDiscard message
forward메시지 전달하기
isvalidDetermine if message is valid
lengthDetermine length of message queue

상태 활동

in상태 활동 검사
enter상태가 활성화되면 묵시적 이벤트 생성
exit상태가 비활성화되면 묵시적 이벤트 생성

데이터형 변환

boolean숫자형 값을 부울 값으로 변환
ascii2struint8 유형의 배열을 문자열로 변환하기
str2ascii문자열을 uint8 유형의 배열로 변환하기
str2double문자열을 배정밀도 값으로 변환하기
string값을 string형으로 변환
tostring값을 string형으로 변환
typeType of Stateflow data object

문자열 생성 및 결합

blanks공백으로 구성된 문자형 배열
plus문자열 결합하기
strcpy문자열 값 할당하기
strcat문자열 결합하기

문자열 데이터 속성

isletterDetermine which characters are letters in Stateflow chart
isspaceDetermine which characters are spaces in Stateflow chart
isstring입력값이 문자열인지 확인
strlen문자열의 길이 결정하기
strlength문자열의 길이 결정하기

부분문자열 찾기 및 바꾸기

contains문자열에 부분문자열이 포함되었는지 확인
startsWith문자열이 부분문자열로 시작하는지 확인
endsWith문자열이 부분문자열로 끝나는지 확인
strfind문자열 내에서 부분문자열 찾기
extractAfter위치 뒤의 부분문자열 추출
extractBefore위치 앞의 부분문자열 추출
substr문자열에서 부분문자열 추출하기
replaceFind and replace substrings in Stateflow chart
replaceBetweenReplace substrings between start and end points in Stateflow chart
strrep부분문자열 찾기 및 바꾸기
erase문자열 내에서 부분문자열 삭제
eraseBetweenDelete substring between start and end points in Stateflow chart
insertAfterInsert string after substring in Stateflow chart
insertBeforeInsert string before substring in Stateflow chart

문자열 데이터 편집하기

lower문자열을 소문자로 변환
upper문자열을 대문자로 변환
reverseReverse order of characters in strings in Stateflow chart
stripRemove leading and trailing characters from string in Stateflow chart
strtrim문자열에서 선행 공백과 후행 공백 제거

문자열 데이터 비교하기

matches두 문자열이 일치하는지 확인
strcmp문자열 비교(대/소문자 구분)
strcmpi문자열 비교(대/소문자 구분 안 함)
strncmpCompare first N characters of strings in Stateflow chart (case sensitive)
strncmpiCompare first N characters of strings in Stateflow chart (case insensitive)

시간 논리

after이벤트 브로드캐스트 또는 지정된 시간 후에 차트 실행
at이벤트 브로드캐스트 또는 지정된 시간에 차트 실행
before이벤트 브로드캐스트 또는 지정된 시간 전에 차트 실행
every일정한 간격으로 차트 실행
duration조건이 유효한 시간
elapsed상태가 활성화된 이후의 시간
count조건이 유효한 동안의 차트 실행 횟수
temporalCount상태가 활성화된 이후의 이벤트 수, 차트 실행 횟수 또는 시간 길이

MATLAB 코드와의 상호 작용

thisAccess chart data during simulation

도움말 항목