You can use the built in MATLAB function for finding the Greatest Common Divisor (GCD) for every two consecutive numbers in the array and accumulate the result in some variable GCD. If GCD = 1, then the numbers are coprime. Otherwise, they are not coprime and GCD is their common factor.
Here is the code:
function GCD = iscoprime(x) % assuming x is an array,
GCD = x(1); % returning greatest common divisor for the array
for i=1:size(x, 2)
GCD = gcd(GCD, x(i));
end
end