Why do I get "Array indices must be positive integers or logical values" error when using "angle" function?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hey guys, does anyone know whats wrong.
I already have my line code working. But once I run it on appdesigner.
It display "Array indices must be positive integers or logical values".
Can you guys help me pls![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1216367/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1216367/image.png)
댓글 수: 2
Fifteen12
2022년 12월 2일
Do you mean to be redefining e and e2? Right now you're not using either of those initial values...
Jiri Hajek
2022년 12월 2일
Hi, if you need some real testing from the community, you have to attach the code, not just a screenshot...
답변 (2개)
Fifteen12
2022년 12월 2일
Without seeing your code it's impossible to answer your question, but try outputing all your variables to the terminal, it's easy to have a mistake. To make it easier, try debugging your script by placing a breakpoint early in your code and stepping through it. You can check each variable as you go, it's probably an honest mistake.
댓글 수: 0
Star Strider
2022년 12월 2일
You have a variable named ‘angle’ somewhere in your workspace. If you run:
which angle -all
the results should be similar to these.
If you have a variable called ‘angle’
angle = pi;
which angle -all
the results should demonstrate that as well.
The solution is to rename the variable to something that does not overshadow any MATLAB function.
.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!