Subscript indices must either be real positive integers or logicals???
Mostra commenti meno recenti
I am relatively new to matlab. So I am trying out some logic in the following lines which gives me the error which I think is because one variable is over writing the other though I am not sure how.
CODE:
function f = initial(R,init,num,color)
x = zeros(num,1);
x(1)=init;
t = 0:20:100;
for i = 1:num
x(i+1)= R * x(t) * (1 - x(t));
end
plot(x,t)
end
ERROR:
Subscript indices must either be real positive integers or logicals.
Error in initial (line 7) x(i+1)= R * x(t) * (1 - x(t));
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!