Get names of the current Simulink Block and then store all the inputs and outptus of the block into a structure ?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
sachin narain
am 21 Jan. 2019
Kommentiert: sachin narain
am 22 Jan. 2019
How do i find all the inputs and outputs of a current simulink block and then store the inputs and outputs seperately into two seperate structure blocks in matlab script ?
ALso as you know each input and output have their Name , Data type and others .i also need to store these Name , Data type into the structure .
For example if i press Input.Input_Name = (It should give me all the Name , Data type as field to the structure)
Thank you for the help in advance .
0 Kommentare
Akzeptierte Antwort
Arvind Sathyanarayanan
am 21 Jan. 2019
Bearbeitet: Arvind Sathyanarayanan
am 21 Jan. 2019
Sachin,
You can figure out the number of ports of the current block by using the get_param() command.
blockPorts = get_param(gcb,'PortHandles'); %Generates a structure with port handle
portobj = get_param(blockPorts.inport(1),'ObjectParameters'); %Generates a structure with names of first inport properties
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!