Question: A = [ 3 1 7 4 5 1 0 1 5 ] ; B = [ - 3 3 1 2 6 3 1
A ;
B
Code has already been provided to define variables A and B
Add code that uses the values in A and B to generate the following vectors and scalars and assign them to the indicated output variable names.
Generate a vector named ABrow that is a element row vector consisting of the elements of A followed by the elements of B
Generate a vector named BAcol that is a element column vector consisting of the elements of ABrow in reverse order.
Generate a vector named FirstHalfALastHalfB that is an element row vector consisting of the first elements of A followed by the last elements of B
Generate a vector named BPosSorted that is a column vector that consists of only the positive numbers in B sorted in order from smallest to largest.
Generate a scalar output named NumberOfNegElements that sums how many elements are negative in B
Generate a scalar output named SumOfNegElements that sums the negative elements in B
Note the variables A and B are defined. Do not overwrite their values in your code.
Your code should not include the following MATLAB functions or keywords: if for, while
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
