I am taking private tuition for Matlab programming and I am stumped on this –
I wrote a program to find the prime numbers between X and Y. I need to output the prime numbers into an array… but how? Can you edit this program and show me how?
x = input ('Enter start no.: ')y = input ('Enter end no.: ')for n = x:y count = 0; for b = 1:n if rem(n,b)== 0 count = count+1; end end if count == 2 display(n); endend
Best Answer