15.11.2014 Views

Chapter 4: Programming in Matlab - College of the Redwoods

Chapter 4: Programming in Matlab - College of the Redwoods

Chapter 4: Programming in Matlab - College of the Redwoods

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.

392 <strong>Chapter</strong> 4 <strong>Programm<strong>in</strong>g</strong> <strong>in</strong> <strong>Matlab</strong><br />

<strong>the</strong> numerator and denom<strong>in</strong>ator <strong>of</strong> <strong>the</strong> second fraction <strong>in</strong>put by <strong>the</strong> user. You<br />

will want to make calls to rationalLCD and rationalReduce <strong>in</strong> <strong>the</strong> standalone<br />

function rationalAdd. Once you have <strong>the</strong> function rationalAdd tested and<br />

work<strong>in</strong>g, paste it as a subfunction at <strong>the</strong> bottom <strong>of</strong> <strong>the</strong> file rationalArithmetic.<br />

This is an imporant idea. Write <strong>the</strong> code for <strong>the</strong> smaller task. Test it thoroughly.<br />

When you ga<strong>in</strong> confidence <strong>in</strong> <strong>the</strong> result, <strong>the</strong>n drop it <strong>in</strong> <strong>the</strong> larger program<br />

and coord<strong>in</strong>ate it with <strong>the</strong> exist<strong>in</strong>g code.

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

Saved successfully!

Ooh no, something went wrong!