When would it matter if a for loop contained for i = 1:4 vs. for i = [3 5 2 6], and when would it not matter?
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:5| Question number:4.5
All Answers
total answers (1)
It would matter if the value of the loop variable was being used in the action of the loop. It would not matter if the loop variable was just being used to count how many times to execute the action of the loop.
need an explanation for this answer? contact us directly to get an explanation for this answer