Simulink Export Variable List

조회 수: 5 (최근 30일)
Semaj Kazam
Semaj Kazam 2024년 2월 29일
답변: T.Nikhil kumar 2024년 3월 14일
I am trying to Export variables in a block to a list, inputs and outputs for use in another program.
This should be simple, yes? Export is greyed out.
I also tried to use Find Referenced Variables and get an error.
What is the best way to output a list of variables, excluding commands? Tutorial does not show this.

답변 (1개)

T.Nikhil kumar
T.Nikhil kumar 2024년 3월 14일
Hello Semaj,
Based on your question, I can comprehend that you want to obtain a list of a Simulink block's inputs and outputs.
I would suggest you to try the below mentioned methods which may help you:
  • You can try using the ‘To Workspace’ Simulink block to log both input and output data into the workspace. This data in workspace can then be converted to required format.
  • "Export" is generally greyed out when there are no variables in the workspace. Try right-clicking on the model’s name and select ‘Find Referenced Variables’. Then select all the variables and export selections to a .mat file.
  • The error regarding failure in compiling on using ‘Find Referenced Variables’ could be due to some unresolved issues in the model. Ensure that your model is correctly set up and that all errors in Diagnostic Viewer are resolved.
  • If your goal involves exporting simulation data (i.e., the outputs of your model over time), then the Simulink Data Inspector provides a straightforward way to export such data. Use it instead of the Model Explorer to log variables:
  1. Run your simulation with logging enabled for every input and output signal of the block.
  2. Open the Simulink Data Inspector from ‘Review Results’ section in ‘Simulation’ Tab.
  3. Use the export functionality within the Data Inspector to save the data to the workspace or a file.
Refer to the following documentation for more details:
Hope this helps you proceed further!

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by