Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Matlab ode15s error: subscript indices must either be real positive integers or logicals.
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I have the following differential equation to be solved:
g1=0.988122979147950;
g2=0.644414268521746;
beta1=14.6523799554469;
beta2=-10.9849944881532;
beta3=411.648214174951;
g=227.598238564395;
n=1.56153644411635;
global spxdot;
shapeFunc=@(t,z)1-g1.*exp((-z.*abs(ppval(spxdot,t))/g2).^2).*ppval(spxdot,t).*(1-(beta1.*(sign(ppval(spxdot,t).*z)+beta2.*sign(ppval(spxdot,t)))+beta3.*sign(z)+ g).*(abs(z).^n));
trange=linspace(1,2401,2401)/1000;%converting to seconds
z0=0;%value of z at time t=0
[T,z1]=ode15s(shapeFunc,trange,z0);
But I am getting the following error:
Subscript indices must either be real positive integers or logicals.
Error in
differential>@(t,z)1-g1.*exp((-z.*abs(ppval(spxdot,t))/g2).^2).*ppval(spxdot,t).*(1-(beta1.*(sign(ppval(spxdot,t).*z)+beta2.*sign(ppval(spxdot,t)))+beta3.*sign(z)+g).*(abs(z).^n))
Error in odearguments (line 87)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode15s (line 150)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in differential (line 27)
[T,z1]=ode15s(shapeFunc,trange,z0);
Would somebody point out where I am doing the mistake? I double-checked the parens and operators but found nothing wrong.
Thanks,
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!