Question: For loop practice Write a code segment that utilizes a loop to find the sum of each item in the row vector NUM_LIST. Store the
| For loop practice Write a code segment that utilizes a loop to find the sum of each item in the row vector NUM_LIST. Store the result in a variable named SUM_OF_LIST. Find the sum of the indices of the list and store in a variable SUM_OF_INDICES. (Both variables will contain a single value.) Example: % test case % NUM_LIST = [ 5 10 15 55]; % SUM_OF_LIST = 5 + 10 + 15 + 55; % SUM_OF_INDICES = 1 + 2 + 3 + 4; |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
