How would I find the total number of prime numbers between 1 million and 2 million on MATLAB. I have the code for displaying every prime number between 2 integers being:
n = firstnumber : secondnumber; p = isprime(n); n(p) %displays the primes
But how would I code it so it gives me a total number of primes between 2 numbers.
Any help will be appreciated.