finding the divisors for a number displaying the divisors between two numbers.
1 view (last 30 days)
Show older comments
I am trying to find the divisors of a number say 84 and I need to show the divisors from 2 to 20 so if the divisors are div=[1 2 3 6 7 14 21 42 84] how can I show the selected numbers between the numbers 2 and 20 (2</= div >/=20) so I get an answer of div=[1 2 3 6 7 14]
so far I have and I know this isnt right
%function div = finddivisor(a)
divisors(84)
disp(a>1)
disp(a<21)
this gets me close to my answer but i dont know how to get it into a form that shows the divisors alone
1 Comment
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!