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.

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

K>> P, R, T<br />

P =<br />

5000<br />

R =<br />

0.1000<br />

T =<br />

8<br />

Notice that we are <strong>in</strong> <strong>the</strong> function workspace, not <strong>the</strong> base workspace. Now<br />

end <strong>the</strong> debugg<strong>in</strong>g session and allow <strong>the</strong> function to complete its execution with<br />

<strong>the</strong> follow<strong>in</strong>g command.<br />

K>> dbcont<br />

When execution <strong>of</strong> simpleInterst3 completes, we are returned to <strong>the</strong> caller,<br />

<strong>in</strong> this case <strong>the</strong> base workspace. Exam<strong>in</strong>e <strong>the</strong> contents <strong>of</strong> P , R, and T <strong>in</strong> <strong>the</strong> base<br />

workspace.<br />

>> P, R, T<br />

P =<br />

1000<br />

R =<br />

0.0600<br />

T =<br />

10<br />

This is clear evidence that <strong>the</strong> base workspace and <strong>the</strong> function workspace<br />

are separate entities.

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

Saved successfully!

Ooh no, something went wrong!