Write a user-defined function that finds all the prime numbers between two numbers m and n. Name

Question:

Write a user-defined function that finds all the prime numbers between two numbers m and n. Name the function pr=prime (m, n), where the input arguments m and n are positive integers and the output argument pr is a vector with the prime numbers. If m > n is entered when the function is called, 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 when the function is called, the error message "The input argument must be a positive integer." is displayed. Do not use MATLAB's built-in functions primes and is prime. Use the function with:
(a) prime(l2,80)
(b) prime(21,63.5)
(c) prime(l00,200)
(d) prime(90,50)
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: