function PD=PercentDifference(a,b)
% function PercentDifference(a,b) calculates the percent difference between
% two numbers or vectors.  Used as an example of how to write a simple
% function. If a>b, the result is positive. The input arguments a and b can
% be scalars or vectors. If both are vectors, they must be the same length.
%
% Examples:
% PercentDifference(1,1.1)
% ans =
%   10.0000
%   
% a=[1.1 1 .9];
% b=[1.02 .99 .98];
% PercentDifference(a,b)
% ans =
%     7.2727    1.0000   -8.8889
%
% See also mean, std, rsd 
PD=100.*(b-a)./a;
