Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab Code, Hardware and Software Integration Write a MATLAB function, named arrayCollide, that combines two input arrays, sorts them in the descending order, and then

Matlab Code, Hardware and Software Integration image text in transcribed
Write a MATLAB function, named arrayCollide, that combines two input arrays, sorts them in the descending order, and then returns a new array of a specified size. Your MATLAB function should accept four inputs in the following order: 1. . firstArray: a 2-dimensional array of any size. .secondArray: another 2-dimensional array that may have a different size than that of firstArray. nRows: a number specifying the number of rows for the new output array ncols: a number specifying the number of columns for the new output array. Your MATLAB function should produce an output array, called resultarray, of size nRows-by- ncols that contains the first nRowsxnCols elements of arrays firstArray and secondArray, which are sorted in the descending order column-wise. If nRowsxnCols islarger than the total number of the elements in arrays firstArray and secondArray, then then function should fill empty spots with the minute portion of the current time. Test your function by writing a MATLAB script that repeatedly sets the values of firstArray secondArray, nRows, and nCols, and then calls the function arrayCollide to produce the output resultArray. You can use the built-in MATLAB functions like rand, randn, randi, magic, eye, etc. to generate these input arguments. This script should print the inputs, the output result, and the current time of running the script in a formatted text. You can create as many test cases as you wish For example, if firstArray3 21; 5 4 61 secondArray - [7 8; 9 10; 12 11] nRows3 ncols = 5 This test was run on 01/24/2019 at 10:54:25 resultArray

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

Evaluating Group Performance?

Answered: 1 week ago