Question: 21. Create a row vector vC=2:3:38 that has 13 elements. Then, create the following new vectors by assigning elements of vC to the new vectors:
21. Create a row vector vC=2:3:38 that has 13 elements. Then, create the following new vectors by assigning elements of vC to the new vectors:
(a) A vector (name it vCodd) that contains all the elements with odd index of vC; i.e., vCodd = 2 8 14 ... 38.
(b) A vector (name it vCeven) that contains all the elements with even index of vC; i.e., vCeven = 5 11 17 ... 35.
In both parts use vectors of odd and even numbers to address the elements of vC that are assigned to vCodd, and vCeven, respectively. Do not enter the elements of the vectors explicitly.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
