Subscript indices must either be real positive integers or logicals???
Mostrar comentarios más antiguos
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));
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!