Write a function called makemat that will receive two row


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 0s to the end of one vector first, that is pad it, to make it as long as the other. For example, a call to the function might be:

>> thismat = makemat([1:5], [2:9])

thismat =

1 2 3 4 5 0 0 0

2 3 4 5 6 7 8 9

>> thismat = makemat([2:6], [1:3])

thismat =

2 3 4 5 6

1 2 3 0 0

>> thismat = makemat([2:6], [10:14])

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a function called makemat that will receive two row
Reference No:- TGS01150060

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)