Question: Write a function called CombineNon Zeroes that takes three non-zero numbers each from two 1D arrays and concatenates them in a new1D array The input

 Write a function called CombineNon Zeroes that takes three non-zero numbers

Write a function called CombineNon Zeroes that takes three non-zero numbers each from two 1D arrays and concatenates them in a new1D array The input arguments: inArray1: A double precision 10 array of size n. Three of its elements are non-zeroes. The rest are zeroes. inArray2: A double precision 1D array of size n. Three of its elements are non-zeroes. The rest are zeroes. The output arguments: outArray: A double precision 10 array of size 8. It should contains the non-zeroes of inArray1 in their original order from left to right, following by the non-zeroes of inArray2 in their original order from left to right. For example, inArray1 = [004 305] inArray2 = 1100270] outArray = CombineNonZeroes(inArray1, inArray2) This results in the output: outArray = [ 43 51271 The output array contains the non-zeroes of the input arrays stacked together. The output array contains a total 6 non-zeroes. Function Save e Reset EL MATLAB Documentation 1 function (outArray] = CombineNonZeroes(inArray, inArray) end Code to call your function e Reset 1 inArray1 = [ 8 4 3 5 ]; 2 inArray2 = ( 12 8 2 7 0 ]; 3 outArray = CombineNon Zeroes (inArray, inArray2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!