Generating a list of Simulink model's IOs

5 Ansichten (letzte 30 Tage)
Vincent Nicolazzo
Vincent Nicolazzo am 13 Mär. 2019
Beantwortet: Pruthvi G am 14 Mär. 2019
I have a very large Simulink model with a lot of inputs and outputs. Is there a way to generate a list of all these input and output names? Right now I generate C-code and copy the data structures that are created and import that into an excel spreadsheet. I'd like to be able to run a function of some sort that automatically creates this list.
Thanks in advance
  2 Kommentare
Astik Sachan
Astik Sachan am 14 Mär. 2019
Can you share the Dummy Model and sort of Excel File you need ?
Vincent Nicolazzo
Vincent Nicolazzo am 14 Mär. 2019
I attached a dummy model. But I'd like to have a list of the inputs and outputs, does not need to be in excel. This is for documention purposes. It will be used for writing adtional code that accesses the model strucutre in C. I don't want to keep referring to the model to see what inputs and outputs I have. I'd like to get a list like below:
Inputs:
In1
In2
In3
Outputs:
Out1
Out2
Out3

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Pruthvi G
Pruthvi G am 14 Mär. 2019
% Finding the Inputs
Inports_path = find_system('DummyModel','BlockType','Inport');
Inputs = get_param(Inports_path,'Name');
% Finding the Outports
Outports_path = find_system('DummyModel','BlockType','Outport');
Outputs = get_param(Outports_path,'Name');
% Writing into Excel sheet.
xlswrite('Inports_outports.xlsx',[{'Inputs'} {'Outputs'}],1,'A1');
xlswrite('Inports_outports.xlsx',Inputs,1,'A2');
xlswrite('Inports_outports.xlsx',Outputs,1,'B2');
Run the above script and you get a list of inputs in inputs and outputs in outputs.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Report Generator 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!

Translated by