Question: solve all please Write a MATLAB script m-file that performs the following: a. Use a for loop to keep a running sum of the integers
solve all please
Write a MATLAB script m-file that performs the following: a. Use a for loop to keep a running sum of the integers between 1 and 25 Define a summation variable before the loop that is initially equal to 0. Inside the loop, add the current index to the summation variable (except in the case below). If the current index is 13, skip that iteration of the loop (continue to the next iteration) without adding to the summation. If the current summation exceeds 200 (after adding in the current index). print the current index and break out of the loop. After the loop exits, display the final value of the summation. b. Use a while loop to implement exactly the same thing as the for loop above. Hint You'll have to define and increment the index manually
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
