MATLAB: How to keep same time range when sending data form Simulink to Matlab

MATLABplottingsimulink

hi, I am Simulating a model in simulink and want to plot a graph of the output in MatLAB, but when i send it to MatLAB the time range changes, for example, when its in Simulink, its 300 seconds but when sent to MatLAB its 1200 seconds, basically I want the same response from the scope only in MatLAB.
Thanks
Johnny

Best Answer

I suspect you are viewing partial of your curve in Simulink scope. See this post: http://www.mathworks.com/matlabcentral/answers/5591-scope-time-not-shown-to-full-simlation
You may have ploted your curve in Matlab without time so your x-axle is just number of data samples. By default, the simulation time is sent to the workspace as "tout", so try, plot(tout, YourVariable). You can change this by click menu:
Simulation-> Configuration parameters ... -> Data Import/Export