Question: Please help! lines 1-3 must stay the same, but I wrote the code and it says I'm wrong can you please show me the right


Please help! lines 1-3 must stay the same, but I wrote the code and it says I'm wrong can you please show me the right code.
Problem 1.3 Write a function named sumnots that computes the sum of all entries of the input matrix that are not equal to 3. Function Save e Re 1 function mod_sum - sumnot3(A) 2 [rows cols] = size(A); mod_sum = e.e; 3 4. 5 for m=1: rows for n=1:cols 6 7 8 if A(m,n) -= 3 mod_sum += A(m,n); 9 10 end end 11 12 end 13 mod_sum 14 end Code to call your function 1 sumnot3([1 2 3; 4 5 6; 7 8 9]) 2 sumnot3([3 3 3 3; 3 3 3 3]) 3 sumnot3([1 1 1 1; 1 1 1 1]) % correct answer 1+2+4+5+6+7+8+9=42 % correct answer o % correct answer 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
