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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 ......
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply