Page 1 of 1

MATLAB : How to set a function with editor to find prime number (1~n) without using prime(X)? for example ,and using rem

Posted: Sat Nov 27, 2021 10:36 am
by answerhappygod
MATLAB : How to set a function with editor to find prime number
(1~n) without using prime(X)? for example ,and using rem(n) to
write it , the prime number cannot be divisoned by 2 3 5
7
it can show :findprime(10)= 2 3 5 7 findprime(11)=2 3 5 7 11
findprime(12)=2 3 5 7 11 findprime(50)= 2 3 5 7 11 13 17 19 23 29
31 37 41 43 47 findprime(n)=2 3 5 7 11 13 17 19 ......