Why do I get "Array indices must be positive integers or logical values" error when using "angle" function?

Illustration
Rebekah - 2020-11-04T10:24:40+00:00
Question: Why do I get "Array indices must be positive integers or logical values" error when using "angle" function?

Why do I get "Array indices must be positive integers or logical values" error when using "angle" function?     >> z = 22+i >> a = angle(z) >> z = 22.0000 + 1.0000i Array indices must be positive integers or logical values.

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

Based on the error message, it seems like you have a variable with the name "angle" stored in your workspace that overshadows the "angle" function


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!