I want to check this property with code in Simulink StateFlow. I found that there is no direct identifier. Is there any way to check this option? (Create output for monitoring
5 次查看(过去 30 天)
显示 更早的评论
I want to check this property with code in Simulink StateFlow. I found that there is no direct identifier. Is there any way to check this option?
(Create output for monitoring:)

0 个评论
回答(1 个)
Divyajyoti Nayak
2024-12-17
编辑:Divyajyoti Nayak
2024-12-20
To programmatically check the option “Create output for monitoring” in the Stateflow chart’s properties, you can make use of the “HasOutputData” property of the “Stateflow.Chart” object.
chart.HasOutputData = 1;
The 'OutputMonitoringMode' property can be used to set the mode of the output data.
chart.OutputMonitoringMode = ‘ChildActivity’;
To access your Stateflow chart object, the “find” function can be used.
chartArray = find(sfroot,"-isa","Stateflow.Chart");
Here’s some documentation to help you out:
“find” function: https://www.mathworks.com/help/stateflow/api/accessing-existing-stateflow-objects.html
'HasOutputData' :
“OutputMonitoringMode”:
3 个评论
Divyajyoti Nayak
2024-12-20
Oh my mistake, then instead of the 'OutputMonitoringMode' property, you can use the 'HasOutputData' property. I'll edit the answer above.
Ying Fu
2025-2-10
Yes, you can remove the check box with this setting
chart.HasOutputData = 0;
This is the mode for modifying it
chart.OutputMonitoringMode = ‘ChildActivity’;
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!