Answered step by step
Verified Expert Solution
Link Copied!

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?

image text in transcribed

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 integer

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions