t=1:50:1000;
fun=@(t)exp(-(t-600)^2/2/196.62^2)/(sqrt(2*pi)*196.62);
for i=1:length(t)
a(i)=quad(fun,1,t(i));
end
为什么我这个进不能运行呢
??? Error using ==> mpower
Matrix must be square.
Error in ==> quad at 62
y = f(x, varargin{:});
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
按你前面变上限函数积分上写的我改了一下
clear all
warning off
x=linspace(0,150);
for k=1:length(x)
xx=x(k);
fun=inline('exp(-(t-600)^2/2/196.62^2)/(sqrt(2*pi)*196.62)');
w(k)=0.62.*2./sqrt(pi).*quadl(fun,0,1);
end
plot(x,w)
又是一片红
??? Error using ==> inlineeval
Error in inline expression ==> exp(-(t-600)^2/2/196.62^2)/(sqrt(2*pi)*196.62)
??? Error using ==> mpower
Matrix must be square.
Error in ==> inline.feval at 34
INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Error in ==> quadl at 64
y = feval(f,x,varargin{:}); y = y(:).';
[ 本帖最后由 lxc0531 于 2008-8-3 13:03 编辑 ] |