This program finds prime numbers manually

matlab already has a function to do this but i wanted to see if i could code it manually
370.0 次下载
更新时间 2011/9/2

查看许可证

this program works by first asking for a positive integer say 16. then it creates an array ranging from 2 to 16. next all the numbers are divided by 2 and all that return back a integer are deleted from the array except for 2. example 4/2 =2, 4 will be deleted. after this, this same pattern continues with 3 and so on until the array is dived by ceil(sqrt(n)) so for the case of n=16, 2 and 3 can root out all of the non primes

引用格式

nathanial hapeman (2024). This program finds prime numbers manually (https://www.mathworks.com/matlabcentral/fileexchange/32774-this-program-finds-prime-numbers-manually), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Numeric Types 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0