Question: please use matlab and show the screenshot 1. Write a 'for loop program to implement the following requirements: (a) First, creates a 25-element vector with
1. Write a 'for loop program to implement the following requirements: (a) First, creates a 25-element vector with random integers between 10 and 20 by using the command: x = randi([-10 20),1,25). (b) Then, use a "for loop' to examine each of the element in the vector x. If the element is a positive and odd number, its value is doubled. If the element is negative, its value is squared. Otherwise, its value is divided by 2. (e) Lastly, displays the original vector and the modified vector side-by-side
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
