Question: Write a script that first prompts the user for an n value to use to create an nn matrix of integers in the range [1,
Write a script that first prompts the user for an n value to use to create an nn matrix of integers in the range [1, 20]. The script should then prompt the user for an m value to use to extract the m m centered inner matrix from the random matrix. You may assume that if n is odd then m is odd and if n is even then m is even. An nn matrix of random integers between nMin and nMax can be generated using randi( [ nMin, nMax ], n ). Your script should generate the random matrix, extract the inner portion into a new variable, display the results, and save the extracted inner matrix to a file.

3. Write a script that first prompts the user for an n value to use to create an nx n matrix of integers in the range 1.201. The script should then prompt the user for an m value to use to extract the m m centered inner matrix from the random matrix. You may assume that if n is odd then m is odd and if n is even then m is even. An n n matrix of random integers between nMin and nMax can be generated using randi( [ nMin, nMax ], n ) Your script should generate the random matrix, extract the inner portion into a new variable, display the results, and save the extracted inner matrix to a file. Sample output: Enter n for a size nxn matrix: 5 Enter m for the inner m x m matrix to extract: 3 The 5 x 5 random matrix is: 18 7 14 Th l48i4 The 3 x 3 inner matrix is: 7 18 16 1418 2 13 10 11 5 8 7 17 8 16 14 17 18 16 14 13 10 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
