for loop label/arguement
1 次查看(过去 30 天)
显示 更早的评论
Need to iterate over the bifurcation map n_trans time (n_trans specified above), this is the relevant bit of the code for my question.. which is pretty basic.. what is wrong with the below? I get the error message
"Error in solution: Line: 25 Column: 20
Invalid array indexing."
(no longer line 25 ofc...)
many thanks
x(1)=0.5;
for j=2:(n_trans-1)
x(j+1)=mu*x(j)(1-x(j));
end
0 个评论
回答(1 个)
Walter Roberson
2021-4-18
That looks suspiciously like an Octave message rather than a MATLAB message...
x(j+1)=mu*x(j)(1-x(j));
^^
MATLAB has no implied multiplication, not anywhere -- not even inside the binary language of the moisture vaporators.
10 个评论
Walter Roberson
2021-4-22
for i=mu_min:mu_max
Should be
for i=1:n_mu
and
x(j)=mu*x(j-1)*(1-x(j-1));
should refer to mu(i)
Possibly some output should stored indexed at i
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!