error: Array indices must be positive integers or logic
Afficher commentaires plus anciens

please help
Réponses (2)
VBBV
le 2 Fév 2024
y(i) = y(i) + 1;
instead of
y(II) = y(II) + 1;
Walter Roberson
le 2 Fév 2024
0 votes
Due to floating point round-off, the result A+(B*x(i)) might not be exactly an integer. You should round() it.
2 commentaires
Kayla Garcia
le 2 Fév 2024
Walter Roberson
le 2 Fév 2024
You have not posted enough context to really give you an answer.
But I suspect that you should have made x one element shorter. Something along the line of
x = linspace(xmin, xmax, number_of_steps+1);
x = x(1:end-1);
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
