I plotted a signal using "To Workspace" in Simulink Matlab. Now I want to take the mean of the specific part of that signal which I plotted.How can I extract values from "To Workspace" or how can I take the mean of the specific area of that graph.
0
votes
1 Answers
3
votes
In "To workspace" you define a variable name, let's say: "simout" I made a simple simulink as the following:
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
and you can plot the data:
plot(t,x)