matlab/simulink and graphs

Discussion in 'Homework Help' started by hunterage2000, Feb 20, 2012.

  1. hunterage2000

    Thread Starter Senior Member

    May 2, 2010
    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.
  2. MrChips


    Oct 2, 2009
    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.
  3. steveb

    Senior Member

    Jul 3, 2008
    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: Feb 21, 2012