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 and some Maximum value which user specifies that.
Write a subfunction 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 subfunction.
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 eg which rows and which columnsThe replaced numbersThe matrix B
MATLAB
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
