PDA

View Full Version : Matlab - simple plot where 0<x<5


Elemc
Jan30-11, 04:24 PM
Hi

This has got to be easy but I can't find the answer anywhere. How can I use 'plot' where the x axis does not include the end points 0 or 5? All the examples I see are things like x=[0:0.1:5].

Thanks in advance.

MATLABdude
Jan30-11, 11:51 PM
Hi Elemc,

If I understand correctly (i.e. you don't want any whitespace before / after your data points), you can make use of the axis or xlim functions to control the plot area (links go to Mathworks documentation pages):
http://www.mathworks.com/help/techdoc/ref/axis.html
http://www.mathworks.com/help/techdoc/ref/xlim.html