How can I get the port number of a StateFlow input given it's handle programatically?

조회 수: 5 (최근 30일)
I have the handle of a StateFlow input from a previous find result. I'm trying to get the port number for that StateFlow input. I've been using the sf('get',<handle num>,<field name>) command for other fields like 'data.name', 'data.scope', etc. but can't see where I can get the port number. Can anyone help me with this?

채택된 답변

Jorge Calvo
Jorge Calvo 2021년 10월 5일
It sounds like you are working with Stateflow.Data objects, where you have the ID property and want to find the Port property. In that case, you can do this:
>> x = find(sfgco,Id=301);
>> x.Port
4
  댓글 수: 4
Jorge Calvo
Jorge Calvo 2021년 10월 8일
편집: Jorge Calvo 2021년 10월 8일
You can use sfroot instead of sfgco. That will look at all the Stateflow charts you have loaded.
>> x = find(sfroot,Id=301);
Eric Bender
Eric Bender 2021년 10월 8일
Fantastic!!! Thank you Jorge that worked perfectly.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by