<< Chapter < Page Chapter >> Page >
This module is part of the collection, A First Course in Electrical and Computer Engineering . The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.

In command mode, MATLAB displays a prompt ( ) and waits for your input. You may type any legal mathematical expression for immediateevaluation. Try the following three examples (press “enter” or “return” at the end of each line):

The variableis built into MATLAB, as are thefunction and hundreds of other functions. When you entered each of the preceding lines,MATLAB stored the results in a variable calledfor answer . The value ofwas then displayed. The last line should have produced the square root of 2. We can manipulateto find out ans

The new answer is very close to 2, as expected. Let's see what the roundoff error is:

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, A first course in electrical and computer engineering. OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10685/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'A first course in electrical and computer engineering' conversation and receive update notifications?

Ask