Question: Write a MATLAB program that will Type the following array and use MATLAB commands to answer the following questions 3 7 -4 12 -59 10

 Write a MATLAB program that will Type the following array and
use MATLAB commands to answer the following questions 3 7 -4 12
-59 10 2 A= 6 13 8 11 15 5 4 1

Write a MATLAB program that will Type the following array and use MATLAB commands to answer the following questions 3 7 -4 12 -59 10 2 A= 6 13 8 11 15 5 4 1 For testing purpose, we will regenerate the n'm matrix A with n=4 adn m>=4 using random number Create a vector v consisting of the elements in the second column of A Create a vector w consisting of the elements in the second row of A. Create a nx 3 array B consisting of all elements in the second through fourth columns of A. Create a 3 x m array C consisting of all elements in the second through fourth rows of A. - Create a 2 x 3 array D consisting of all elements in the first two rows and the last three columns of A . Find the maximum and minimum values in each column of A. Find the maximum and minimum values in each row of A. Find the maximum and minimum values in A. Sort each column and store the result in an array E. (using sort) Sort each row and store the result in an array F. . Add the elements in each column and store the result in an array G Add the elements in each row and store the result in an array H. . 1 Dard code A based on the matrix given, check the output yourself to see if you understand how to input a 2-D array manually. A [3 7 -4 12; -5 9 18 2; 613 8 11; 15 5 4 1); 4 * for the testing purpose, we will now regenerate the nes matrix A with no adn med using random number to prevent hard coded solu Snrandi([48]) % Random row number for A matrix between 4 to 7 Emrandi([4 8]) X Random colum number for A matrix between 4 to 7 7 A = randi(-10 2e), n, n) % random A matrix of size nem with the numbers between 10 to 20. # Hint: you can comment out line 5-7 first to test your answers for the following questions on your own MATLAB installation using th 9 X end as index means the end index number for row or column depends on where you use it. 10 11 Create a vector v consisting of the elements in the second column of A 12 V-[7 9 13 5); 13 14 xCreate a vector w consisting of the elements in the second row of A. 15 W-[-5 9 10 2]; 16 17 xCreate a n * 3 array 8 consisting of all elements in the second through fourth columns of A. 18 - 21 C 20 Create a 3 m array c consisting of all elements in the second through fourth rows of A. I 2 xcreate a 2 x 3 array o consisting of all elements in the first two rows and the last three columns of A. 24 D-C7 -4 12; 9 10 2] 26 Find the maximum and minimum values in each column of A. using max and win fucntion 27 maximumCol= max(A) 20 minimumCol- min(A) 10 XFind the maximum and minimum values in each row of A. 31 maximumRow 32 minimunRows 4 Find the maximum and minimum values in A. 21 C= 23 Create a 2 x 3 array D consisting of all elements in the first two rows and the last three columns of A. 24 D-[7 -4 12; 9 10 2] 25 26 XFind the maximum and minimum values in each column of A. using max and min fucntion 27 maximumCol-max(A) 28 minimumCol- min(A) 29 se XFind the maximum and minimum values in each row of A. 31 maximum Row= 32 minimumRow 23 34 XFind the maximum and minimum values in A. 35 max- 36 min 57 38 Sort each column and store the result in an array E. (using sort) 29 E 40 41 Sort each row and store the result in an array F. 42 F 43 44 *Add the elements in each column and store the result in an array G. I 45 G 46 47 Add the elements in each row and store the result in an array H. Assessment

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!