Array indices must be positive integers or logical values
1 次查看(过去 30 天)
显示 更早的评论
Help me please. An error occurs when starting the program. How do I fix it?
0 个评论
回答(2 个)
Jan
2021-8-30
I looks like this is a script. Then is shares the workspace variables with its caller. I guess, that you have created an array called "real" anywhere. Then real(Io) does not call the function real(), but uses the values of Io as indices.
Check this by:
which real
Using function avoids such confusions, because you can check the local code, if a variable with such a name is created.
Avoid using names of builtin functions for variables.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!