필터 지우기
필터 지우기

How to get all the selected objects in a stateflow diagram?

조회 수: 4 (최근 30일)
John Karter
John Karter 2020년 6월 30일
댓글: John Karter 2020년 6월 30일
I am trying to run some code in a Stateflow model when its objects are selected. How do I find which objects have been selected??
Thanks in advance!

답변 (1개)

Gaganjyoti Baishya
Gaganjyoti Baishya 2020년 6월 30일
Hi, please try this code snippet. It worked for my use-case.
rt = sfroot;
m = rt.find('-isa', 'Stateflow.Machine', '-and','Name',bdroot);
visChart = m(1).find('Visible',1); % find stateflow chart handle
editor = visChart.Editor; % Editor object of the current
curObj = editor.selectedObjects;
curObj stores all the SF objects that are selected.

카테고리

Help CenterFile Exchange에서 Complex Logic에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by