How do I check for invalid integers in an array?
Show older comments
I keep getting the error: Array indices must be positive integers or logical values.
1 Comment
Nicole Peltier
on 23 Sep 2018
You're getting the error because you're trying to access desired_temp(0). In Matlab, array indices start at 1.
Answers (1)
madhan ravi
on 23 Sep 2018
Edited: madhan ravi
on 23 Sep 2018
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
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!