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
Best Answer