15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Plotting Mathematical Functions<br />

Plotting Mathematical Functions<br />

The fplot function plots a mathematical function between a given set <strong>of</strong> axes<br />

limits. You can control the x-axis limits only, or both the x- and y-axis limits.<br />

For example, to plot the humps function over the x-axis range [-5 5], use<br />

fplot(@humps,[-5 5])<br />

grid on<br />

100<br />

80<br />

60<br />

40<br />

20<br />

0<br />

−20<br />

−5 −4 −3 −2 −1 0 1 2 3 4 5<br />

You can zoom in on the function by selecting y-axis limits <strong>of</strong> -10 and 25, using<br />

fplot(@humps,[-5 5 -10 25])<br />

grid on<br />

4-5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!