error in plotting lyapunov exponent from time series
2 次查看(过去 30 天)
显示 更早的评论
Is there any command to plot maximal lyapunov exponent from time series for which i tried my own codes. but still i m in a stage where i get the error:
r =
0
??? Subscript indices must either be real positive integers or logicals.
Error in ==> mlcmainbifr at 10 lyap1=lyap([t,x(:,1)]); pls help me in giving any idea and best suggestions.
kinds regards matlab codes:
clc
global r
for r=0.0:0.1:30 r
lyap(1)=.01;
[t,x]=ode45('loreeneq',0:1:500,[.01,.01,.01]);
lyap1=lyap([t,x(:,1)]);
plot(r,lyap1,'r');
drawnow
end
xlabel ('r');ylabel('lyap') ---------------------------------------------------------------------- function dxdt=loreeneq(t,x)
global r
dxdt1=10*(x(2)-x(1));
dxdt2=(r*x(1))-x(2)-(x(1)*x(3));
dxdt3=(x(1)*x(2))-(2.67*x(3));
dxdt=[dxdt1;dxdt2;dxdt3];
0 个评论
采纳的回答
Andrew Newell
2012-1-10
Is lyap supposed to be a variable or the function in the Control Toolbox? If the former, you can't index it with t and x because they are real variables, not integers. I can't suggest a fix because I don't know what you are trying to do in enough detail.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Computations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!