Try this:
x=0:5;y=0:5; plot(x,y);grid on; set(gca,'XLim',[-20 20]); set(gca,'YLim',[-20 20]);
Try this:
x=0:5;y=0:5; plot(x,y);grid on; set(gca,'XLim',[-20 20]); set(gca,'YLim',[-20 20]);
Continue on with
xlim([-20 20]); ylim([-20 20])
... but for that range of values I would suggest
xlim([-2 2]); ylim([-2 2])
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!