How to save the graph obtained with Simulink's scope as numerical data

4 ビュー (過去 30 日間)
光希
光希 2024 年 9 月 25 日
コメント済み: 光希 2024 年 9 月 26 日
I have plotted voltage and current using the scope. I want to save the waveforms as a table of time and voltage values ​​with a sampling time of 0.001 seconds.

採用された回答

Epsilon
Epsilon 2024 年 9 月 25 日
編集済み: Epsilon 2024 年 9 月 25 日
Hi 光希,
To export the voltage and time, use the 'outport' block to save the data in the MATLAB base workspace and then convert them into a table.
  1. Add an 'Outport' block connect the voltage signal to it.
  2. Then, configure the "Data Import/Export" in the "Model Configuration Parameters" to save time and voltage in the base workspace by checking Time and Output checkbox, also change "Format" to "Array".
  3. In MATLAB convert the arrays into a table by:
waveformTable=table(tout,yout)
%tout and yout are the default variable names defined while configuring "Data Import/Export".
Note: Model needs to be pre-configured to have a sampling time of 0.001 seconds as the sampling time depends on the parameters passed in the block used.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScopes and Data Logging についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by