How can I get the port number of a StateFlow input given it's handle programatically?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Eric Bender
il 22 Lug 2021
Commentato: Eric Bender
il 8 Ott 2021
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?
0 Commenti
Risposta accettata
Jorge Calvo
il 5 Ott 2021
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 Commenti
Jorge Calvo
il 8 Ott 2021
Modificato: Jorge Calvo
il 8 Ott 2021
You can use sfroot instead of sfgco. That will look at all the Stateflow charts you have loaded.
>> x = find(sfroot,Id=301);
For more information, you can check out: https://www.mathworks.com/help/stateflow/api/overview-of-the-stateflow-api.html.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Simulink Functions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!