Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The code is already entered. Just need the variables solved using MatLab. Thanks in advance. Write a MATLAB program that will Type the following array
The code is already entered. Just need the variables solved using MatLab. Thanks in advance.
Write a MATLAB program that will Type the following array and use MATLAB commands to answer the following questions A=356157913541084122111 For testing purpose, we will regenerate the nm matrix Awth 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 fow of A - Create a n3 array B consisting of all elements in the second through fourth columns of A. - Create a 3m array C consisting of all elements in the second through fourth rows of A. - Create a 23 array D consisting of all elements in the first two rows and the iast three columns or A. - Fino the maximum and minimum values in each column of A - Find the macumum and minimum values in each fow or A. - Find the maximumi ang minimum yalues it A - Sort eash columin and store the resuni in an array E (using sort) - Sort each con and store the resuit in an array F - Add the elaments in eacn colurnn and shore the resuet in an atray G - fodd the eentents in ebch rof and arore the resuit in on array ri. Whard code A based on the matrix given, check the output younself to see if you understand how to input a 2-0 array annaliy. AA. \% for the testing purpese, we wil1 now regenerate the n= matrix A with n>4 adn m>4 using randon nunber to prevent hard coded solu n= randi ([4.8]) X Randos rou number for A matrix betueen 4 to 7 6. mi - randl ([4.8]) * fandon colun number for A matrix between 4 to 7 7A= randi ([-10 20],n,m) * fandom A matrix of 51znenn with the nunbers between 19 to 20 . 5. X Rinit: you can connent out 1 ine 57 first to test your ansivers for the following questions on your can riarla fintallation asing th \& Y end as Index neans the end Index nunber for roo or colum depends on wbere you use 1t. XCreate a vector y consisting of the elements in the second colunn of A 12. ve= 13 14 X Greate a yectoria consistling of the elements in the secand now of A. as inw Whreate an3 array 8 consisting of all elenents in the sacond through founth colutrs of a. in E- 2o thcriate 3 xi e array c consisting of all elenents in the second through fourti nous of a. C. 1 n the matrix given, check the output yourself to see if you understand how to input a 2D array manually, 3 4 rpose, we ad12 now negenerate the nm matnix A with n>A adn m ) 4 using random nunber to prevent harid coded solut fon 5. andom now number for A matrix between 4 to 7 6 andon colun number for A matrix between 4 to 7 7n,m) z randos A matrix of 5 fite nm with the nusbers between 10 to 20 . filent out line 57 first to test your ansuers for the follewing questlons on your oun Matcab installatfon using the aiven array. the end Index number for row or coluen depends on where youl use it. onsisting of the elenents in the second coluan of A 17. 1) 14 onsitting of the elenents in the second rav of A. 15 14 on ye conskatifigiof all elenents 1h the second thirough fourtb colunns of A. ge yo conisistifie of all elenents lifi, the 'second through fourtn rous of A. 23 XCreate a 23 array D consisting of all elenents in the first two rows and the last three columns of A. 24 D- XFind the maximun and minimum values in each column of A. using max and min fucntion maximuscol= minimumCol= XFind the maximum and minimum values in each row of A. maximumRow minimumRown YFind the maximum and minimum values in A. 35 maxAa= 36 minA = 37 35 XSort each column and store the result in an array E. (using sort) 39 E. 61. WSort each now and store the result. In an array F. 42. f= 43 44 Thdd the eleaents in each column and storn the result in an array Q. As Ge a) TAdd the oleoents in each now and store the result in an array H Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started