Stateflow capture

12 views (last 30 days)
Junung
Junung on 18 Apr 2025
Answered: Angelo Yeo on 18 Apr 2025
matlab 코드로 Stateflow 내부 다이어그램 전체를 캡쳐하여 PNG 파일로 저장하고 싶습니다.
print(['-s', sysName], '-dpng', '-r100', image_path) 함수를 사용하여 image_path에 sysName 경로에 있는 stateflow 저장을 시도하였으나,
내부 stateflow가 저장되는 것이 아닌, 해당 stateflow를 감싸는 블록 1개의 형태로만 png파일로 저장이 됩니다.

Answers (1)

Angelo Yeo
Angelo Yeo on 18 Apr 2025
sfprint 함수를 활용해 보십시오. 아래는 예시입니다.
model = 'mymodel'; % Simulink 모델 이름
chartName = 'Chart';
load_system(model);
% Stateflow API 사용
rt = sfroot;
modelObj = rt.find('-isa', 'Simulink.BlockDiagram', 'Name', model);
chart = modelObj.find('-isa','Stateflow.Chart','Name',chartName);
sfprint(chart.Path, "png", "file", 0)
아래는 제 MATLAB Desktop (R2024b)에서 실행한 결과입니다.

Categories

Find more on 복잡한 논리 in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!