error: Array indices must be positive integers or logic
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1606536/image.jpeg)
please help
0 comentarios
Respuestas (2)
Walter Roberson
el 2 de Feb. de 2024
Due to floating point round-off, the result A+(B*x(i)) might not be exactly an integer. You should round() it.
2 comentarios
Walter Roberson
el 2 de Feb. de 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);
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!