
几道有关matlab的题目,不要怪我懒,我是学机电的,cad,solidworks……学了很多没想到选修还要用matlab!
1个回答
展开全部
clear
i=1;
sum=0;
while i<=200
sum=sum+i;
i=i+1;
end
sum
clear
x=-1:0.01:1;
y=-1:0.01:1;
[x,y]=meshgrid(x,y);
z=0.54*exp(-0.75*x.^2-3.75*y.^2-1.5*y).*(x+y>1)+0.7575*exp(-x.^2-6*y.^2).*(x+y<=1).*(x+y>-1)+0.5457*exp(-0.75*x.^2-3.75*y.^2+1.5*y).*(x+y<=-1);
figure(1)
surf(x,y,z)
shading flat
clear
x=0:0.01:20*pi;
y0=cos(100*x);
ys=cos(x);
y=y0+ys;
figure(2)
subplot(3,1,1)
plot(x,y)
subplot(3,1,2)
stem(abs(fft(y))/length(y)*2)
N=15;
Wn=0.2;
B=FIR1(N,Wn);
yy=filter(B,1,x);
subplot(3,1,3)
plot(x,yy)
i=1;
sum=0;
while i<=200
sum=sum+i;
i=i+1;
end
sum
clear
x=-1:0.01:1;
y=-1:0.01:1;
[x,y]=meshgrid(x,y);
z=0.54*exp(-0.75*x.^2-3.75*y.^2-1.5*y).*(x+y>1)+0.7575*exp(-x.^2-6*y.^2).*(x+y<=1).*(x+y>-1)+0.5457*exp(-0.75*x.^2-3.75*y.^2+1.5*y).*(x+y<=-1);
figure(1)
surf(x,y,z)
shading flat
clear
x=0:0.01:20*pi;
y0=cos(100*x);
ys=cos(x);
y=y0+ys;
figure(2)
subplot(3,1,1)
plot(x,y)
subplot(3,1,2)
stem(abs(fft(y))/length(y)*2)
N=15;
Wn=0.2;
B=FIR1(N,Wn);
yy=filter(B,1,x);
subplot(3,1,3)
plot(x,yy)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询