Answer:-----------
In MATLAB
1). FOR loops:
- Repeat a block command a certain number of times
- Use a loop index
- Can use a non-unit stride
- Are required for any kind of animations
Answer:----------- Repeat a block command a
certain number of times
2). An accumulator:
- MUST start at zero
- Can be used to keep track of a quantity each time through the
loop
- Can be used to calculate how a sum changes with each loop
- Should be coded, for loops are more efficient
Answer:------- MUST start at zero
3). For loops:
- Perform a set task a set number of times
- Is a smarter way to count and are counter controlled
- Continue to perform a task as long as the condition is met
- Are condition controlled until some condition is met
Answer:---- Continue to perform a task as long
as the condition is met
4). When using while loops:
- The script describes an incremental the loop until a final
condition becomes true
- Has the advantage that the condition and increment are
flexible
- Can use non-unit strides
- Use index variables to rotate the quantity being changed
Answer:---- The script describes an incremental
the loop until a final condition becomes true.