Generating a list of Simulink model's IOs
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Pruthvi G
2019-3-14
% 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.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Report Generator 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!