Simulink to matlab results display

조회 수: 27 (최근 30일)
Kevin Peel
Kevin Peel 2012년 1월 4일
I'm trying to display some results from simulink. At the moment I have them as shown here:
As the datasets are so different I would like to display them as shown here:
What's the easiest way to do this? Export them back into matlab is what I have been trying, using the simout function. But then trying to plot them in the matlab environment gives me errors.
Thanks for any help.

채택된 답변

C.J. Harris
C.J. Harris 2012년 1월 4일
Export the signals from Simulink by using the 'To Workspace' block. Set the save format as 'Structure With Time'. In Matlab you can then plot the data using the plot command:
plot(simout.time, simout.signals.values);
However, if you have muxed multiple signals together (such as the four in the attached image), you can use subplot to show all the various signals individually. For example:
subplot(4,1,1)
plot(simout.time, simout.signals.values(:,1));
subplot(4,1,2)
plot(simout.time, simout.signals.values(:,2));
subplot(4,1,3)
plot(simout.time, simout.signals.values(:,3));
subplot(4,1,4)
plot(simout.time, simout.signals.values(:,4));
  댓글 수: 1
Kevin Peel
Kevin Peel 2012년 1월 4일
That has worked perfectly. Thank you so much.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by