function y = posmedian(x)
% y = posmedian(x)
%
% x column vector
%
% return y = median of all non-negative entries in x

if size(x,2) == 1
    y = median(x(x>=0));
else 
    y = NaN;
end


% function y = median(x)
% n = length(x);
% x = sort(x);
% if n > 0
%     y = x(round(n/2));
% else
%     y = [];
% end
