Page 114 - A Guide to MATLAB for Beginners and Experienced Users
P. 114
Working with M-Books 95
Figure 6-1: A Simple M-Book.
Working with M-Books
You interact withdata in your M-book in two ways — via the keyboard or
through the menu bar.
Editing Input
Place your cursor in the line containing the second command of the previous
section — where we solved the quadratic equation
2
x − 5x + 5 = 0.
Click to the left of the equal sign, hit BACKSPACE, type 6 (that is, replace the
second 5 by a 6), and press CTRL+ENTER. You will see your output replaced by
ans =
[2]
[3]
By changing the quadratic equation we have altered its roots. You can edit
any of the input lines in your M-book in this way, including the one that
generated the graph. See what happens if you click in the ezplot command
line, change the cubic expression, and press CTRL+ENTER.