Array indices must be positive integers or logical values

조회 수: 4(최근 30일)
Help me please. An error occurs when starting the program. How do I fix it?


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.
  댓글 수: 1
Andrey Alexandrov
Andrey Alexandrov 2021년 8월 30일
Jan, thank you very much for your comment. The program started

댓글을 달려면 로그인하십시오.

Wan Ji
Wan Ji 2021년 8월 30일
You can do this by
Iout = double(Io)
  댓글 수: 1
Andrey Alexandrov
Andrey Alexandrov 2021년 8월 30일
Wan Ji, thank you so much for your comment

댓글을 달려면 로그인하십시오.


Find more on Large Files and Big Data in Help Center and File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by