Question: Write a user defined function using Matlab that determines if a number is a prime number Name the function pr=Trueprime (m), where the input arguments

Write a user defined function using Matlab that determines if a number is a prime number Name the function pr=Trueprime (m), where the input arguments m is a positive integer and the output argument pr is 1 if m is a prime number and 0 if not a prime number. Do not use Matlab's built in functions primes and isprime. 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. A. Use the function with 733, 2001,and 107.5 B.Write a Matlab program in a script file that makes use of Trueprime and finds the smallest prime number that remains a prime number when added to its reverse (37 is the reverse of 73).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!