
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The below small program shows to draw a contour plot of the function I used
x=[-3:0.1:3];
y=x;
[X Y]=meshgrid(x,y)
contour(X, Y, X.^2+Y.^2,[4 4])
hold on;
contour(X,Y,exp(X)+Y,[1 1])
grid on;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$x^2+y^2=4, \quad e^x+y=1 $. Type this command in Matlab
If you need to solve the above equation
>> [X Y]=solve('x^2+y^2=4','exp(x)+y=1')
and you should obtain
X =
-1.8162640688251505742443123715859
Y =
0.8373677998912477276581914454592
No comments:
Post a Comment