ax.xlim = [0 100];] in matlab

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.m
x = 1:100;
y = sin(x);
plot(x, y);
xlim([0, 100]);
51 chars
5 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.

related categories

gistlibby LogSnag