Borrar filtros
Borrar filtros

How to get bus types for in bus element and out bus element in simulnk model through command line?

4 visualizaciones (últimos 30 días)
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.

Respuestas (2)

Shubh Pareek
Shubh Pareek el 9 de Jun. de 2023
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 -

Houji Wu
Houji Wu el 12 de Jun. de 2023
I had tried "CompiledPortDataTypes" method,but i did not get the bus type,always return the type of bus element.Here is my test model,scripts and bus type.
i want to get the bus type as the red box in the picture.

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by