Question: programming languages (MATLAB) Let M be a matrix whose entries are positive integers. What does the following function do? function v=Summat (M) [m n]-size (M);

programming languages (MATLAB) Let M be a matrix whose entries are positiveprogramming languages (MATLAB)

Let M be a matrix whose entries are positive integers. What does the following function do? function v=Summat (M) [m n]-size (M); v=zeros(n,1); for i=1:1 for j=1:m if mod (M(j, i),2)--0 v(i)=v(i)+M(),1); end end end Creates a vector whose ith entry is the sum of the odd elements of the ith column of M Creates a vector whose ith entry is the sum of the even elements of the ith column of M Creates a vector whose ith entry is the sum of the odd elements of the ith row of M Creates a vector whose ith entry is the sum of the even elements of the ith row of M

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!