for loop label/arguement
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Walter Roberson
il 18 Apr 2021
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 Commenti
Walter Roberson
il 22 Apr 2021
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
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!