Question: MATLAB question: 2. (8 points) A vector is given by v=[16, 13, -19, 110, 15, 10,-18, 111, -15]. Write a MATLAB program (a3q2.m) that creates
MATLAB question:

2. (8 points) A vector is given by v=[16, 13, -19, 110, 15, 10,-18, 111, -15]. Write a MATLAB program (a3q2.m) that creates the vector v, then uses a for-loop and nested if-statements to (i) divide each positive even element of v by 2, (ii) multiply each positive odd element of v by 3, and (iii) square (i.e., raise to the power 2) each of the negative elements. Then, output the new vector to the screen as The new vector is: 8 39 361 55 45 5 324 333 225
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
