Question: Write a main function which can take two variables as inputs to indicate the number of rows and columns of a matrix A . Inside

Write a main function which can take two variables as inputs to indicate the number of rows and columns of a matrix A.
Inside the function generate a nxm matrix A using the inputs. All the integer elements must be randomly picked. Also, all the numbers must be between 1 and some Maximum value which user specifies that.
Write a sub-function which can take the addresses (row and column) of two of the elements of matrix A and replace them with another two numbers that the user is requesting from inside of sub-function.
Store the updated matrix with the new two elements into a variable B.
Each time the user runs the program, the output must display:
The original matrix AThe specific indices of the elements in matrix A which are being replaced (e.g. which rows and which columns).The replaced numbersThe matrix B
MATLAB

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 Programming Questions!