15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

6 Sparse Matrices<br />

The vertices <strong>of</strong> one pentagon are numbered 1 through 5, the vertices <strong>of</strong> an<br />

adjacent pentagon are numbered 6 through 10, and so on. The picture on the<br />

following page shows the numbering <strong>of</strong> half <strong>of</strong> the nodes (one hemisphere); the<br />

numbering <strong>of</strong> the other hemisphere is obtained by a reflection about the<br />

equator. Use gplot to produce a graph showing half the nodes. You can add the<br />

node numbers using a for loop.<br />

k = 1:30;<br />

gplot(B(k,k),v);<br />

axis square<br />

for j = 1:30, text(v(j,1),v(j,2), int2str(j)); end<br />

1<br />

14<br />

0.8<br />

0.6<br />

18<br />

17<br />

15<br />

13<br />

11 12<br />

0.4<br />

19<br />

16<br />

2<br />

10<br />

0.2<br />

20<br />

3<br />

9<br />

0<br />

1<br />

6<br />

−0.2<br />

22<br />

4<br />

8<br />

−0.4<br />

23<br />

21<br />

5<br />

7<br />

−0.6<br />

−0.8<br />

24 25<br />

27<br />

26<br />

29<br />

30<br />

−1<br />

28<br />

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1<br />

To view a template <strong>of</strong> the nonzero locations in the Bucky ball’s adjacency<br />

matrix, use the spy function:<br />

spy(B)<br />

6-20

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

Saved successfully!

Ooh no, something went wrong!