error: Array indices must be positive integers or logic
1 次查看(过去 30 天)
显示 更早的评论
回答(2 个)
Walter Roberson
2024-2-2
Due to floating point round-off, the result A+(B*x(i)) might not be exactly an integer. You should round() it.
2 个评论
Walter Roberson
2024-2-2
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);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

