function updatestats(h)

tsdata = h.Timeseries.Data;
tableData =  cell(size(tsdata,2),6);
for k=1:size(tableData,1)
    I = find(~isnan(tsdata(:,k)));
    if ~isempty(I)
        tableData(k,:) = {sprintf('%d',k),sprintf('%0.3g',mean(tsdata(I,k))), ...
            sprintf('%0.3g',median(tsdata(I,k))),...
            sprintf('%0.3g',std(tsdata(I,k))),...
            sprintf('%0.3g',min(tsdata(I,k))),...
            sprintf('%0.3g',max(tsdata(I,k)))};
    else
        tableData(k,:) = {sprintf('%d',k),'','','','',''};
    end
end
h.Handles.statsTable.setData(tableData);