function [a,changes]=nht(a,b)
% "no higher than" replaces any numbers in vector a that are above the
% scalar b with b. Optionally "changes" returns the number of changes.
%
% Example:
% v=[1 2 3 4 0 6 7 0 9 .5];
% b=nht(v,4);
% plot(1:length(v),v,1:length(v),b,'o')
%
% Related functions nlt.m, rmz.m, rmnan.m
%
La=length(a);
changes=0;
for point=1:La
    if a(point)>b
        a(point)=b;
        changes=changes+1;
    end
end
