matlab/simulink and graphs

Thread Starter

hunterage2000

Joined May 2, 2010
487
Hi, Does anyone know how to change the x axis from points to time when you plot a variable from the To Workspace block in Simulink?

I tried plotting tout and the variable together but it says 'vectors shoould be the same length' and I have no clue what that means.
 

MrChips

Joined Oct 2, 2009
30,824
If you are plotting graphs using plot(x,y) the size of x must be the same as the size of y.
You can use plot(y) for plotting equally spaced time series.
 

steveb

Joined Jul 3, 2008
2,436
Hi, Does anyone know how to change the x axis from points to time when you plot a variable from the To Workspace block in Simulink?

I tried plotting tout and the variable together but it says 'vectors shoould be the same length' and I have no clue what that means.
The tout variable is a decimated version of the time stamp. What I do is use the clock block from the "source" library. Then the output of the clock can be fed into its own To Workspace block and given a name like "TimeX". Then use the plot command "plot(TimeX, Y)
 
Last edited:
Top