How do I check for invalid integers in an array?

I keep getting the error: Array indices must be positive integers or logical values.

1 Kommentar

You're getting the error because you're trying to access desired_temp(0). In Matlab, array indices start at 1.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

madhan ravi
madhan ravi am 23 Sep. 2018
Bearbeitet: madhan ravi am 23 Sep. 2018

0 Stimmen

Start the loop from one i.e.,
for n = 1:4

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 22 Sep. 2018

Bearbeitet:

am 23 Sep. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by