Question: Question 1b. Problem definition For this question start by saving q1a.m into q1b.m. Modify the code in your script so that you create another vector

Question 1b. Problem definition For this question start by saving q1a.m into q1b.m. Modify the code in your script so that you create another vector C that contains 2 raised to the power of each element of A. Note, that you can raise 2 to any value in MATLAB by using the pow2 function. So, for example, pow2(3) will produce the value 8. Again, your program should work for any values of A in the range - 100 to 100 not just the current values of A. Testing For this question you should, in a text file called q1b.txt, write a table containing three new test cases. As a reference example, two possible test cases for this are: A [1 2 4] [2 4 16] [-1 0 1] [0.5 1 2] Coding Now code your solution to the problem above in your q1b.m file. Make sure you include some code at the end to display the vector C. In your coding, consider whether you can use the same for-loop to produce the vector C or whether you have to use a second for-loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
