Uploaded by khai le

Matlab report-1B.b

advertisement
1B Function and Graph
1B.b Graph in Mathlab or Scilab
Question 29: Sketch the graph of the function f(x, y)= 9 - x2-9y2
Result
Using Scilab we get :
Scilab Code:
function z=f(x,y)
z=9-x^2-9*y^2
endfunction
x=-20:20;
y=-20:20;
for i = 1 : length(x)
for j = 1 : length(y)
z(i,j) = f(x(i), y(j));
end
end
plot3d(x,y,z);
References
[1] J. Steward, Calculus. Concepts and Contexts, 7 th ed., Thomson Learning, 2012.
[2] Matlab
Download