You can set xlim
property of the current axes by calling the xlim
function and passing it a vector of two values that represent the lower and upper limits of the x-axis respectively. Here's an example:
main.m51 chars5 lines
This code sets the xlim
property of the current axes to [0, 100]
, which means the x-axis limits will go from 0 to 100. Note that this assumes you already have an axes object and are plotting onto it. If not, you will need to create an axes object first using the axes
function before calling plot
and xlim
.
gistlibby LogSnag