Page 68 - A Guide to MATLAB for Beginners and Experienced Users
P. 68

Algebra and Arithmetic         49


                      6. Use simplify or simple to simplify the following expressions:
                                         1
                        (a) 1/(1 + 1/(1 + ))
                                         x
                                      2
                               2
                        (b) cos x − sin x
                      7. Compute 3 301 , bothas an approximate floating point number and as an
                        exact integer (written in usual decimal notation).
                      8. Use either solve or fzero, as appropriate, to solve the following equa-
                        tions:
                        (a) 8x + 3 = 0 (exact solution)
                        (b) 8x + 3 = 0 (numerical solution to 15 places)
                             3
                         (c) x + px + q = 0 (Solve for x in terms of p and q)
                             x
                        (d) e = 8x − 4(all real solutions). It helps to draw a picture first.
                      9. Use plot and/or ezplot, as appropriate, to graphthe following functions:
                                 3
                        (a) y = x − x for −4 ≤ x ≤ 4.
                                       2
                        (b) y = sin(1/x ) for −2 ≤ x ≤ 2. Try this one with both plot and ezplot.
                            Are bothresults “correct”? (If you use plot, be sure to plot enough
                            points.)
                         (c) y = tan(x/2) for −π ≤ x ≤ π, −10 ≤ y ≤ 10 (Hint: First draw the plot;
                            then use axis.)
                                                  2
                                              4
                        (d) y = e −x 2  and y = x − x for −2 ≤ x ≤ 2 (on the same set of axes).
                                           4
                                                  x
                     10. Plot the functions x and 2 on the same graph and determine how many
                        times their graphs intersect. (Hint: You will probably have to make several
                        plots, using intervals of various sizes, to find all the intersection points.)
                        Now find the approximate values of the points of intersection using fzero.
   63   64   65   66   67   68   69   70   71   72   73