Site logo MA251: Calculus I
Fall 2008
MA251
Readings
Problems
Matlab
In class we have learned how to differentiate implicitely. Of course, now you would want to see pretty pictures of the graphs in matlab. To do this, we will invoke Matlab's command ezplot. For example, if you want to plot the function
x^2+y^2=4
you would type the following in Matlab

>>ezplot(@(x,y)x.^2+y.^2-4,[-10 10],[-10 10])

So, what is going on? The @(x,y) tells Matlab that the function is in terms of x and y. Next, comes the function itself. Notice that the 4 is subtracted not equal. When using ezplot the function assumes to be equal to 0. Also, as always, do not forget to use the . when dealing with multiplication, division, powers, etc. Next, there are two brackets: the first represents the domain and the second represents the values of the range. You may notice that the figure does not look like a circle. To remedy this look at the different options for the axis by typing help axis. So in this case, to make the figure look more like a circle type

>>axis square

In class, we calculated the tangent to the circle at the point (1, 3 ) is
y = -1\3 x + 4\3
To plot this in Matlab type the following

>>ezplot(@(x,y)y+1/sqrt(3).*x-4/sqrt(3),[-10 10],[-10 10])

Again, notice that this function is the one we calculated in class with all the variables on one side of the equation. That's it! You now have all the tools to plot functions that are implicitely made of two variables x and y.