p(1)=0;
for t=2:512
p(t)=0.99*p(t-1)+sin^2*(800*t)
e(t)=5*sin(800*(t+pi/3))-r
y(t)=10*sin(800*t)
u=input('输入数值v:')
a(t+1)=a(t)+u*e(t)*y(t)/p(t)
end
for k=0:511
t=1:n
H(k)=a(k)*10*sin*(800*(t-k))
end
r=sum(H(k))
e(t)=5*sin(800*(t+pi/3))-r
a(t+1)=a(t)+u*e(t)*y(t)/p(t)
for k=0:511
t=1:n
H(k)=a(k)*10*sin(800*(t-k))
end
r=sum(H(k))
e(t)=5*sin(800*(t+pi/3))-r
polt(e(t))
这个程序用DEBUG后RUN后,显示的是
??? Error using ==> sin
Not enough input arguments.
Error in ==> sin at 14
[varargout{1:nargout}] = builtin('sin', varargin{:});
Error in ==> l at 3
p(t)=0.99*p(t-1)+sin^2*(800*t)
下面是另外一个
p(1)=0;
for t=2:512
b(x)=“正态分布”
p(t)=0.99*p(t-1)+(sin(800*t)+b(x))^2
e(t)=4*sin(1000*n)+5*sin(800*(t+pi/3))-r
y(t)=10*sin(800*t)
u=input('输入数值u:')
a(t+1)=a(t)+u*e(t)*y(t)/p(t)
end
for k=0:511
t=1:n
H(k)=a(k)*10*sin(800(t-k))
end
r=sum(H(k))
e(t)=4*sin(1000*n)+5*sin(800*(t+pi/3))-r
a(t+1)=a(t)+u*e(t)*y(t)/p(t)
for k=0:511
t=1:n
H(k)=a(k)*10*sin(800(t-k))
end;
r=sum(H(k))
polt(e(t))
x(n)=4*sin(1000*n)
plot(x(n))
编程的流程框图在附件里面,本人是第一次用MATLAB编程,不是很懂,请高手帮忙看下,谢谢了
流程图.doc(96.5 KB, 下载次数: 6)