Computing terms of a sequence generated by a nonlinear difference equation
显示 更早的评论
I would like to compute the first 19 terms of a sequence. I find it takes a very long time. Is there something I am missing? Anyway to speed it up?
It takes 78 secs. Using Excel would be instantaneous.
tic
syms alpha
T=19;
X = sym(1:T);
X(1)=0.1;
for i=2:T
X(i)=(1-alpha - X(i-1)).*X(i-1);
end
disp(X)
toc
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!