function [errpct] = pct_err(truev,estv);
% Compute the percent error of two matrices
%
% [errpct] = pct_err(truev,estv);
%
% This gives the actual error if the true value is zero in order to avoid
% dividing by zero.
%
% Matt Allen, June 2006

errpct = (estv - truev)./(truev/100 + (truev==0)); % to eliminate NANS