Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Defining Axes in Matlab plotting

  1. Sep 18, 2011 #1
    Dear Fellows,

    I am plotting in matlab, and defined and axis along horizontal in such a way
    plot (x, u,'re--' )
    but I need to define the limitation of u along vertical axis,,,,

    can any one suggest me the exact for range -5 to +1

  2. jcsd
  3. Sep 18, 2011 #2


    User Avatar
    Gold Member

    well, you need to define u first, have you done that? I told you how to explicitly define the axes themselves in the other other thread where you asked this question, but if you're just looking at defining the ranges you can use the axis command:

    axis([xmin xmax ymin ymax])

    if you don't want to change the x limits, it's:

    axis([xlim ymin ymax])
  4. Sep 19, 2011 #3
    I have define the function u,
    axis([xlim 0 100])
    plot (x, u,'re--' )
    does not give any limitation of y axis,,,, all values are same as the one got without axis([xlim 0 100])
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook