23 Oct 2012
Label a stem plot with the height of each lollipop
function success = labelstem(k,Y,fignum);
%LABELSTEM labels a plot created by STEM with the values on the plot.
% Note that best results are when the y values are close to each other,
% and there are only about 10 elements or less.
% LABELSTEM(k,Y,figure) where k is the discrete time index, Y are the
% values of the series, and figure is the figure handle of the STEM plot.
% Authored by Nathan West September 2009
for element = 1:numel(Y)
val = sprintf('%3.2f',Y(element));
if sign(Y(element)) == 1