How to determine the dimensions of output signal from a Simulink block programmatically?

8 次查看(过去 30 天)

采纳的回答

MathWorks Support Team
To determine the dimension of output signal from a Simulink block programmatically, please follow these steps:
1. Get the port handles of the required Simulink block. To do this, you can use the "Port Handles" Parameter.
For example:
Handles = get_param('test/Add', 'PortHandles');
This will return a struct. You can isolate Outport handles by accessing it like this :
OutHandles = Handles.Outport
2. You can now use the "CompiledPortDimensions" on the corresponding handle to get the dimensions.
For example: 
Dimensions = get_param(Outport, 'CompiledPortDimensions');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by