# Matematicas

Solo disponible en BuenasTareas
• Páginas : 82 (20359 palabras )
• Descarga(s) : 0
• Publicado : 4 de septiembre de 2012

Vista previa del texto
3 Plotting In Matlab
In this chapter we introduce Matlab technique to draw the graph of functions in a variety of formats. We will begin our work in the plane, plotting the graphs of function, then moving to graphs deﬁned by parametric and polar equations. We’ll then move to 3-space and investigate the nature of curves and surfaces in space.

3.1 Plotting in the Plane . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Plotting Functions of a Single Variable Two or More Plots Exercises Answers Parametric and Polar Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parametric Equations Polar Equations Algebraic Curves Exercises Answers Surfaces in Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . Plotting Functions of Two Variables A Bit More Interesting Exercises Answers Parametric Surfaces in Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercises Answers Space Curves in Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Handle Graphics Viviani’s Curve Exercises Answers 157 158 168 174 176 181 181 186 191 195 198203 204 210 214 215 219 230 233 239 241 244 251 254

3.2

3.3

3.4

3.5

156 Chapter 3

Plotting In Matlab

Section 3.1

Plotting in the Plane 157

3.1 Plotting in the Plane
In the last section we investigated the various arrayoperations available in Matlab. We discovered that most Matlab functions are “array smart,” operating on a vector or matrix with the same ease as they do on single numbers. For example, we can take the square root of a single number. >> sqrt(9) ans = 3 We can just as easily take the square root of each entry of a vector. >> x=[0 1 4 9, 16, 25, 36] x = 0 1 4 9 >> y=sqrt(x) y = 0 1 2 3

16

2536

4

5

6

We also saw that we can easily plot the results. The result of the following command is shown in Figure 3.1 >> plot(x,y,’*’)

Figure 3.1. Plotting y = at discrete values of x.
1

x