How to get bus types for in bus element and out bus element in simulnk model through command line?
8 次查看(过去 30 天)
显示 更早的评论
How to get bus types for in bus element and out bus element in simulnk model through command line? get_param('myModel/In1', 'OutDataTypeStr') return the data type of bus element,not bus types of port.
0 个评论
回答(2 个)
Shubh Pareek
2023-6-9
So to get information regarding in_bus element or out_bus element in simulink model from command line, you can use the `get_param` function along with the `CompiledPortDataTypes` parameter as shown below:
inBusTypes = get_param('myModel/In1', 'CompiledPortDataTypes.Inport')
outBusTypes = get_param('myModel/Out1', 'CompiledPortDataTypes.Outport')
And now from the structure returned by `CompiledPortDataTypes.Inport` and `CompiledPortDataTypes.Outport`, you can extract the names and data types of each bus element within the bus object imported into a Simulink model.
I hope this answers your query .
some other related answers and resource -
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!