function B = nanremover(A)

% Deletes all rows of a matrix
% containing a Nan value. 

[m n] = size(A);

B = A;
nanrows = 0;

for i = 1:m
    for j = 1:n
        if isnan(A(i,j))
            B(i - nanrows,:) = [];
            nanrows = nanrows + 1;
            break
        end
    end
end