Defining Axes in Matlab plotting

  • Context: MATLAB 
  • Thread starter Thread starter adnan jahan
  • Start date Start date
  • Tags Tags
    Axes Matlab Plotting
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 7K views
adnan jahan
Messages
93
Reaction score
0
Dear Fellows,

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


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

Regards
 
Physics news on Phys.org
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])
 
I have define the function u,
x=0:0.2:1.2;
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])