(Solved) : Inputs Double 1xn Vector Inserted Odd Indices Double 1xn Vector Inserted Even Indices Outp Q44063286 . . .
Inputs:
-
(double) A 1xN vector to be inserted into odd indices
-
(double) A 1xN vector to be inserted into even indices
Outputs:
1. (double) A 1x2N vector of your compiled data
Background:
You are a brand new data scientist and have just received yourfirst project: you must use MATLAB to create a data set to bepresented at next week’s conference. The only problem is that theresearcher you are partnered with gave you data that’s all out ofwhack!
Function Description:
You are given two vectors of the same length that must be sortedand then combined. The first vector you are given should be sortedin ascending order. The second vector should be sorted so that itsnew order follows that of the first (i.e. if the 4th index in thefirst vector becomes the 1st index after sorting, the 4th index inthe second vector should also become the 1st index after sorting).Next, combine your two sorted vectors into a single vector oflength 2N, where the odd indices are filled with values from thefirst vector and the even indices are filled with values from thesecond vector.
Example:
data = dataMixer([2 7 1 9], [5 6 3 1]); data → [1 3 25 7 6 9 1]
Hints:
● What does each output of sort() give you?
Expert Answer
Answer to Inputs: (double) A 1xN vector to be inserted into odd indices (double) A 1xN vector to be inserted into even…
OR