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 Comment

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

Sign in to comment.

Answers (1)

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

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Asked:

on 22 Sep 2018

Edited:

on 23 Sep 2018

Community Treasure Hunt

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

Start Hunting!