Question: (10 pts) Fill in the table below. The first column is the value being calculated. You can see how to calculate by reading the code

(10 pts) Fill in the table below. The first column is the value being calculated. You can see how to calculate by reading the code in either Opt. 1 or Opt. 2. Your job is to write the code using the other option. Additionally, you need write what value(s) are stored in the calculated value after the code is complete. (HINT: You must fill in all the gray boxes in the table. HINT 2: Row 1 is an example.) Calc. value? What value(s) are stored in the calculated value? Opt. 2 - Vector Notation Code Opt. 1 - Loop Notation Code n=5; a= n=5; a=2:2:2*n; [2, 4, 6, 8, 10] a=zeros(1, n); for i = 1:n a(i) = 2*i; end x=[10 0 5 -5 20 25]; x=[10 0 5 -5 20 25]; v=[]; xv=[]; for i=1:length(x) if x(i)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
