Question: 2. The Matlab routine in Figure 1 below is executed at the command line as B-fun routine(5) That is, fun routine is called in Matlab

 2. The Matlab routine in Figure 1 below is executed at

2. The Matlab routine in Figure 1 below is executed at the command line as B-fun routine(5) That is, fun routine is called in Matlab with an input argument of n-5. a) The output B is which of the following data types: a scalar, a vector, a m something else? If B is a vector or matrix, what is its size? b) Determine the numerical value of output B, expect zero credit for listing an answer for A. If B is a vector, write out the entries of B in vector form; else if B is a matrix, write out the entries of B in matrix form. 1 function A = funroutine (n) - 3- 4- 5 6 A = zeros (n,n); for i=1:n for j = 1 : n if ( j-i-1 ) A(i,j) = n-1-1; elseif (j>i-1) 8 9 10- end end 12end Figure 1. Matlab code for Problem 2

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!