Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Directions: Write the code to satisify the following directions. For each part, store your answer in the variable that is specified within the parantheses. Ex.
Directions: Write the code to satisify the following directions. For each part, store your answer in the variable that is specified within the parantheses. Ex. Add 1+1.(GT) That means store the value of 1+1 in the variable GT, like so: Ex. GT=1+1 For some of the problems, you can produce two answers with one function call. For instance A=[] B=[] However, when you write your answer, change these two lines into one line to use the 2 outh [A,B]=min(vec) Script These are given variables/values that will be used in the problems arr1=[8273;8721;9381] \%FFor each of these problems, although you can see the values in the variables and could technically hardcode the answers, \%you are encouraged to figure out which of the functions covered can help you accomplish the task. \% Create an array that has the numbers 3 and 7 in the first row, 4 and 5 % in the second row, and 13 and 2 in the third row.(A) (create through direct entry) A=[]; \% Find the number of rows and columsn in 'arr1' and save the number of rows in (B) % and the number of columns in (C) (use the size function) B=[]; C=[] \$Vertically concatenate the arrays 'arr1' and 'arr2' (D) D=[]; \%Index the right half of 'arr1' (assume an even number of columns) (E) E=[]; \%Index the bottom left quadrant of 'arr2' (assume an even number of rows and columns) (F) F=[]; \%FFlip 'arr1' horizontally (you should do this through indexing, not a function) (G) G=[]; \%Transpose 'arr1' (H) H=[]; \%Linearize 'arr1' from a MxN array to a (M*N)x1 column vector based on linear indices(I) I=[]; \%FFind the overall sum of the numbers in 'arr2' J=[] \$50rt arr1 based on sorting the last column in descending order. \$To do this, first you should short the last column in descending order, then use the indices to rearrange all of the \%rows in arr1. The resulting array should be saved in ( K ) (You'll need to do this in multiple lines) K=[]
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