I have created my own function(without using isprime or any other built in functions) to determine whether an integer is a prime number or not. But I need to call the function that I created and input a range of numbers [10 20] and the output should be there are 4 prime numbers btwn 10 and 20 which are 11 13 17 19. I have attached the function that I have created. Thanks I am new to matlab.
MATLAB: How do i determine the output of how many prime numbers are there and list them by the function that i created
functionMATLAB
Related Question
- Write a function ShowPrimes(n) that will find all prime numbers between 1 and n and return them as a vector. Do this using a for loop. Hint: use isprime(x) to check whether x is a prime number. As an example, >> primes=ShowPrimes(20) primes =
- Primes function
- How to make a function that take an integer as input and return ture if this prime otherwise false
Best Answer