Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started