Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can I please get some help with this MatLab program? Write a program according to the following specifications. Unless specified suppress all MATLAB Command Window
Can I please get some help with this MatLab program?
Write a program according to the following specifications. Unless specified suppress all MATLAB Command Window output. After completing the program, the result of executing your program should look similar to the output shown below. (a) Create a variable named N and assign to it an integer obtained by prompting the user to enter the size of a row vector V. Assume the user always enters a positive integer. (b) Create a variable named V and assign to it an N-element row vector whose elements are randomly generated integers uniformly chosen from the closed interval [0, 75]. (c) Declare another for-end statement with a loop-variable named k that will be assigned to every element of a row vector whose elements represent the indices/positions of row vector V. In the body of this for-end statement, perform the following: Count the number of prime numbers contained in row vector V. Use the built-in function isprime. Count the number of elements of row vector V that are multiples of 3 (i.e. evenly divisible by 3), greater than 25, but less than 55. Multiply (and update) each of the elements in vector V that are only multiples of 3 by two times the negative of their index/position within row vector V. (d) Using multiple instances of the built-in fprintf function, display the following: Number of prime numbers contained in V. Format the number as an integer. Number of multiples of 3 contained in V in the range (25, 55). Format the number as an integerStep 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