function p = myprod(a)
%MYPROD    Computes the product of all non-zero elements in vector a.

n = length(a);
p = 1;
for i=1:n
    if a(i) > 0
      p = p*a(i);    
    end
end
