function [str, nCaps] = caps(str)
% Post: Capitalize 1st ltr of each word.
% str partially capitalized string
% nCaps no. of capital letters
% Pre: str string with lower case ltrs and blanks only

nCaps= 0;
if (isletter(str(1)))
str(1)= upper(str(1));
nCaps= 1;
end

for k= 2:length(str)
if (str(k-1)==' ' && isletter(str(k)))
str(k)= upper(str(k));
nCaps= nCaps + 1;
end
end