Question: In this exercise, you will write a function with inputs and outputs that can be vectors and matrices. Write a Matlab function named test _
In this exercise, you will write a function with inputs and outputs that can be vectors and matrices.
Write a Matlab function named testfunction that has two input arguments and three output arguments.
The first input argument is a vector, either a row or column vector. The second input argument is a matrix with the same number of elements as the first input vector argument.
The first output argument must hold result of the elementwise operation where is the th element of the first input vector.
The second output argument must hold the vector of elementwise products between the elements of the vector and matrix inputs. The elements of the matrix are considered in rowwise
order; the elements on the first row, then the elements on the second row, and so forth.
The third output argument is a vector of all zeros of the same length as the first input vector argument, except the first element that hold the maximum of all values in the second input matrix
argument. Moreover, the output should be a row vector when the input vector is a column vector; and, similarly, when the input is a row vector, the output should be a column vector.
In this exercise, you will write a function with inputs and outputs that can be vectors and matrices.
Write a Matlab function named testfunction that has two input arguments and three output arguments.
The first input argument is a vector, either a row or column vector. The second input argument is a matrix with the same number of elements as the first input vector argument.
The first output argument must hold result of the elementwise operation where is the th element of the first input vector.
The second output argument must hold the vector of elementwise products between the elements of the vector and matrix inputs. The elements of the matrix are considered in rowwise
order; the elements on the first row, then the elements on the second row, and so forth.
The third output argument is a vector of all zeros of the same length as the first input vector argument, except the first element that hold the maximum of all values in the second input matrix
argument. Moreover, the output should be a row vector when the input vector is a column vector; and, similarly, when the input is a row vector, the output should be a column vector
PROBLEM:
I keep getting an error that says the output isn't correct for a random row andor column vector input. Or that the size of variable c must be but is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
