for loop label/arguement
조회 수: 2 (최근 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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!