One possible solution in Matlab is:
main.m90 chars8 lines
This will loop through all the numbers between 1000 and 10000, and if a number is prime, it will be added to the primes
array.
Note that isprime
is a built-in Matlab function that returns true if a given number is prime, and false otherwise.
gistlibby LogSnag