Question: ICA 0 4 Part 2 : Matlab Coding Provide a single script file ICAO 4 . m with the Matlab code for the following problems.

ICA 04
Part 2: Matlab Coding
Provide a single script file ICAO4.m with the Matlab code for the following problems. At the top of your file, include a comment containing your name, class section, and the date. Print out each originally generated vector and each final answer to the Command Window, but suppress all other output.
15.(6 points) Generate a row vector with N random integers between 1 and 30, where N itself is a random integer between 10 and 20. Use element indexing to extract alternating elements, beginning from the first element, and store your result in a vector altElems. For example, if the original vector is 19,9,17,24,7,5,21,7,20,16,17, your code should output 19,17,7,21,20,17.
50:100:20
(6 points) Generate a row vector of 20 random integers between 50 and 100. Create a logical index vector that identifies all even numbers in your array (i.e., all numbers that have a remainder of zero when divided by 2 are identified as true). Use your logical index vector and logical operators to create a vector evens that extracts all the even numbers from the original row vector and a variable odds that contains all the odd numbers.
 ICA 04 Part 2: Matlab Coding Provide a single script file

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!