谁帮我做一下这道matlab
发布网友
发布时间:2023-07-20 00:27
我来回答
共2个回答
热心网友
时间:2024-12-05 05:41
x=0:0.0001:4*pi;
x1=zeros(1,length(x)-2);
y=sin(0.5*x)+0.1*randn(1,length(x));
for i=2:length(x)-1
x1(i)=(x(i-1)+x(i)+x(i+1))/3;
end
y1=sin(0.5*x1)+0.1*randn(1,length(x1));
plot(x,y,'r<')
figure,plot(x1,y1,'g<')
热心网友
时间:2024-12-05 05:42
>> t=0:0.0001:2*pi;
>> y=sin(0.5*pi*t)+0.1*randn(1,length(t));
>> y1=zeros(1,length(y)-2);
for i=2:length(y)-1
y1(i)=(y(i-1)+y(i)+y(i+1))/3;
end