MATLAB Answers

How to get all input signal names connected to my simulink block exported in excel file?

10 views (last 30 days)
Rushin Sureja
Rushin Sureja on 11 May 2020
Answered: Mark McBroom on 14 May 2020
I need to get all input signals name to be exported in new excel file for my simulink block by MATLAB code.
Please can anyone tell me how to do that and which MATLAB tools will be required to export to excel file?

  0 Comments

Sign in to comment.

Answers (1)

Mark McBroom
Mark McBroom on 14 May 2020
Here is one approach:
Write MATLAB code that:
  1. use find_system() command to get list of all input ports at top level of model.
  2. write a for loop that iterates over each input port found in step 1. Use get_param() to get the desired information for each port ( for example, name, type, dimensions, etc.)
  3. Collect the information for each port into a MATLAB table
  4. use function writetable() to write the info from step 3 to a XLS file

  0 Comments

Sign in to comment.