hey ! for my code below, I think I avoid "1" for prime number, but it seems like the output still show 1 as an prime number. How should I fix it? Like if you print out [1 3 4 88 5 ], it only returns 3, 5 but here it returns 1,3,5. Can someone help to fix?
function primeVec = vecOfPrimes(vec)k = 1;for i=1:length(vec)n = vec(i);flag = 1;for j=2:sqrt(n)if mod(n, j) == 0flag = 0;breakendendif flag == 1primeVec(k) = n;k = k + 1;endendend