23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

daspect<br />

the window). This means setting the data aspect ratio to a value, including its<br />

current value,<br />

daspect(daspect)<br />

can cause a change in the way the graphs look. See the Remarks section of the<br />

axes description for more information.<br />

Examples The following surface plot of the function z xe is useful to illustrate<br />

the data aspect ratio. First plot the function over the range –2 ≤ x ≤ 2, –2 ≤ y ≤ 2,<br />

x2 y2 = ( – – )<br />

[x,y] = meshgrid([-2:.2:2]);<br />

z = x.*exp(-x.^2 - y.^2);<br />

surf(x,y,z)<br />

0.5<br />

0<br />

−0.5<br />

2<br />

1<br />

Querying the data aspect ratio shows how <strong>MATLAB</strong> has drawn the surface.<br />

daspect<br />

ans =<br />

4 4 1<br />

0<br />

−1<br />

−2<br />

−2<br />

−1<br />

Setting the data aspect ratio to [1 1 1] produces a surface plot with equal<br />

scaling along each axis.<br />

0<br />

1<br />

2<br />

2-365

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

Saved successfully!

Ooh no, something went wrong!