Professional Documents
Culture Documents
plot(simout.time,simout.signals.values)
%1. save your simulink model and your m-file in the same directory
%2. inside the simunlink model rename your scope you want to plot as
mySimScope
%3. in your m-file include the following commands
sim('mySimulinkModel')
open_system('mySimulinkModel/mySimScope') %opens the scope
ylabel('Y-axis')
xlabel('X-axis')
grid on
grid minor
you can save with different formats: Timeseries, Structure with time,
Structure, Array. Then, when you run the simulink, it will save the
variable in the worksapce as a structure. Then you can use the variable
to plot the data inside. check this example : consider you saved using
Structure with time you can get data like this:
t = simout.time
x = simout.signals.values
b blue
g green
r red
c cyan
m magenta
y yellow
k black
w white
https://www.codegrepper.com/code-examples/c/
plot+color+matlab
change plot line color in matplotlib
set(gcf,'color','w');
'y' yellow
'm' magenta
'c' cyan
'r' red
'g' green
'b' blue
'w' white
'k' black