<< Chapter < Page | Chapter >> Page > |
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:
Notification Switch
Would you like to follow the 'A first course in electrical and computer engineering' conversation and receive update notifications?