19.09.2012 Views

Experiments with MATLAB

Experiments with MATLAB

Experiments with MATLAB

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.

4 Chapter 1. Iteration<br />

Figure 1.1. Compute the fixed point by hand.<br />

4<br />

3.5<br />

3<br />

2.5<br />

2<br />

1.5<br />

1<br />

0.5<br />

0<br />

−0.5<br />

−1<br />

−1 0 1 2 3 4<br />

Figure 1.2. A fixed point at ϕ = 1.6180.<br />

Figure 1.2 is our first example of Matlab graphics. It shows the intersection<br />

of the graphs of y = x and y = √ 1 + x. The statement<br />

x = -1:.02:4;<br />

generates a vector x containing the numbers from -1 to 4 in steps of .02. The<br />

statements<br />

y1 = x;<br />

y2 = sqrt(1+x);<br />

plot(x,y1,’-’,x,y2,’-’,phi,phi,’o’)

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

Saved successfully!

Ooh no, something went wrong!