Write a user-defmed function that fmds all the prime numbers between twonumbers m and n

Chapter 7, Problem 22

(choose chapter or problem)

Write a user-defmed function that fmds all the prime numbers between twonumbers m and n. Name the function pr=prime (m, n), where the inputarguments m and n are positive integers and the output argument pr is a vectorwith the prime numbers. If m > n is entered when the function is called,253 the error message "The value of n must be larger than the value of m." is displayed.If a negative number or a number that is not an integer is entered whenthe function is called, the error message "The input argument must be a positiveinteger." is displayed. Do not use MATLAB's built-in functions primesand i sprime. Use the function with:(a) prime(l2,80) (b) prime(21,63.5)(c) prime(l00,200) (d) prime(90,50)

Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.

Becoming a subscriber
Or look for another answer

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back