How to send Simulink variable to matlab?

조회 수: 1 (최근 30일)
632541
632541 2021년 2월 3일
답변: KaMATLAB 2021년 2월 3일
How to send simulink variable to matlab?
I have a variable like a sine wave which is generated in simulink using signal generator.
This signal has to be plot in matlab using "plot ".
I have used "to workspace " in simulink to send it to matlab workspace.
After this ,how can I use this signal (time series) in plot ?
How to plot this?
I have written : plot(t, simout);
Is there any mistake I have made while using simout variable?
  댓글 수: 1
KaMATLAB
KaMATLAB 2021년 2월 3일
click on the 'workspace block' change the Timeseries field to 'array'. Also it is better if you can name your variable for instance y instead of using 'simout'. Also just clik on the 'workspace block' and name your variable

댓글을 달려면 로그인하십시오.

답변 (2개)

Timo Dietz
Timo Dietz 2021년 2월 3일
편집: Timo Dietz 2021년 2월 3일
Timeseries signals can be plotted directly: plot(simout) or separated by x and y: plot(simout.Time, simout.Data)

KaMATLAB
KaMATLAB 2021년 2월 3일
click on the 'workspace block' change the Timeseries field to 'array'. Also it is better if you can name your variable for instance y instead of using 'simout'. Also just clik on the 'workspace block' and name your variable

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by