Scilab Function
Last update : 31/10/2005
isprime - checks number if they are
primes
Calling Sequence
-
I = isprime(a)
Parameters
-
a
: scalar, vector or matrix with positive natural numbers
-
I
: matrix with the same size as a. The elements are 0 or 1. If a
(i,j) is prime, then I(i,j) is 1, otherwise 0.
Description
-
returns 1s for the prime elements in matrix P and 0s for the
others.
-
This function was converted from a Matlab M File
Examples
a=round(30 .*rand(10,4));
P=isprime(a);
disp(a);
disp(P);
See Also
factor
,
Authors
-
Dr. Andreas Geissler geisslea@web.de