Question: What is wrong with my code? Our checking program says all test cases are incorrect. The test cases are determined by the checking program, so


4. Write a for loop to add up every other number in a 2657 list called mylist, starting with the second number. Store the total in eo_total % Sample list mylist =[1 2 3 4 5 6 7 8 9 10]; % Initialize every other total eo_total = 0; % Loop over every other item in mylist for i = 1:2:length(mylist) eo_total = eo_total + mylist(i); end % Display total disp(eo_total); Save) (Reset (Submit to MATLAB MATLAB results: Start of test case 1 totx = totx = totx = 16 25 checking answer checking with a tolerance Output 1 does not match End of test case 1 Start of test case 2 totx = totx = 123 totx = 119 25 checking answer checking with a tolerance Output 1 does not match End of test case 2 Start of test case 3 totx = totx = 123 totx = 119 25 checking answer checking with a tolerance Output 1 does not match End of test case 3 0 of 3 test cases correct
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
