Professional Documents
Culture Documents
x=linspace(0,2*pi);
figure(1)
hold on
plot(x,sin(x),'r')
plot(x,cos(x),'b')
plot(x,tan(x),'g')
axis([0 2*pi -2 2])
grid on
legend('sinx','cosx','tanx')
function gauss1
[x,y]=meshgrid(-pi:2*pi/6:pi,-pi:2*pi/6:pi);
gauss=exp(-x.^2-y.^2);
mesh(gauss)
plot(gauss)
legend('exp(-x.^2-y.^2)')
function gauss2
[a,b]=meshgrid(-pi:2*pi/99:pi,-pi:2*pi/99:pi);
gauss=(exp(-a.^2-b.^2));
mesh(gauss)
plot(gauss)
legend('exp(-a.^2-b.^2)')
function sinpower
icount=0
linecolor='rgbmcykrbm';
x=linspace(0,2*pi);
figure(1)
hold on
for i = 1:10;
icount=icount+1;
plot(x,sin(x).^i,linecolor(icount));
end
axis([0 2*pi -2 2])
grid on
hold off
icount =
0
function cospower
icount=0
linecolor='rgbmcykrbm';
x=linspace(0,2*pi);
figure(1)
hold on
for i = 1:10;
icount=icount+1;
plot(x,cos(x).^i,linecolor(icount));
end
axis([0 2*pi -2 2])
grid on
hold off
icount =
0
sinx
Name
Size
1x100
Bytes
800
em398_coursework_template
gauss1
Name
Size
gauss
x
y
a
b
gauss
Attributes
double
Bytes
7x7
7x7
7x7
gauss2
Name
Class
392
392
392
Class
Attributes
double
double
double
Size
Bytes
Class
100x100
100x100
100x100
80000
80000
80000
double
double
double
Attributes
sinpower
icount =
0
Name
Size
i
icount
linecolor
x
1x1
1x1
1x10
1x100
Bytes
8
8
20
800
Class
Attributes
double
double
char
double
cospower
icount =
0
Name
Size
i
icount
linecolor
x
1x1
1x1
1x10
1x100
Bytes
8
8
20
800
Class
Attributes
double
double
char
double