0% found this document useful (0 votes)
14 views5 pages

Matlab First Attempt by Ntam Gilbert Agha

The document contains MATLAB code that performs various mathematical operations and visualizations. It defines complex numbers, computes their absolute values and angles, and plots functions and surfaces. Additionally, it generates contour plots and saves figures as EPS files.

Uploaded by

j8hvb9cjwd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views5 pages

Matlab First Attempt by Ntam Gilbert Agha

The document contains MATLAB code that performs various mathematical operations and visualizations. It defines complex numbers, computes their absolute values and angles, and plots functions and surfaces. Additionally, it generates contour plots and saves figures as EPS files.

Uploaded by

j8hvb9cjwd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

I=sqrt(-1);

a=2;
b=3;
z1=a+i*b;
z1=2.0000+ 3.0000 I;

i=2;
a=2;
b=3;
z2=a+i*b;
z2=8.0000;
amod=abs(z2)
z2arg=angle(z2)
xv=[-4:.01:4]
yv=(xv.^4 -1) ./(7 *xv.^4 + 32 * xv.^3 +12 * xv.^2 + 32 * xv + 7);
figure(1);
clf;
plot(xv,yv);

x1=[-4:.01:-0.23];
x2=[-0.22:0.01:4];
x=x1;
y1= (x.^4 - 1) ./ (7*x.^4 + 32 * x.^3 + 12 * x.^2 + 32 * x + 7);
x=x2;
y2= (x.^4 - 1) ./ (7 * x.^4 + 32 * x.^3 + 12 * x.^2 + 32 * x + 7);
figure(2);
plot(x1,y1,x2,y2);
x=[-1:0.05:1];
y=[-1:0.05:1];
m=length(x);
n=length(y);
for i=1:m
for j=1:n
z(i,j) =2 * y(j) * x(i)^2 - 2 * y(j)^2 + x(i)^3;
end
end
figure(1);
surf(x,y,z);
xlabel('x');
ylabel('y');
zlabel('z');
print -deps c:\matlab5\sources\polycopie\surf3d.eps
figure(2);
contour(x,y,40); %pour 40 courbes de niveau
print -deps c:\matlab5\sources\polycopie\contour.eps

You might also like