Answered step by step
Verified Expert Solution
Question
1 Approved Answer
31. Write a function called makemat that will receive two row vectors as input arguments, and from them create and return a matrix with
31. Write a function called "makemat" that will receive two row vectors as input arguments, and from them create and return a matrix with two rows. You may not assume that the length of the vectors is known. Also, the vectors may be of different lengths. If that is the case, add 0's to the end of one vector first to make it as long as the other. For example, a call to the function might be: >>makemat (1:4, 2:7) ans = 1 2 2 3 3 4 5 0 0 6 7 31. Write a function called "makemat" that will receive two row vectors as input arguments, and from them create and return a matrix with two rows. You may not assume that the length of the vectors is known. Also, the vectors may be of different lengths. If that is the case, add 0's to the end of one vector first to make it as long as the other. For example, a call to the function might be: >>makemat (1:4, 2:7) ans = 1 2 2 3 3 4 5 0 0 6 7
Step by Step Solution
★★★★★
3.48 Rating (151 Votes )
There are 3 Steps involved in it
Step: 1
function result makematv1v2 maxSize maxlengthv1lengthv...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