% CSHOW.m []=cshow(text,data,fmt,tle,latex) % Displays text and data... % tle='Year H/Y LifeExp': will display over the columns. % latex='latex': will display twice, once with & data & \\ and without. function []=cshow(text,data,fmt,tle,latex); if iscell(text); % If it's a cell instead of a string. Convert % Create strmat version of text for cshow a=text(1); for i=2:length(text); a=[a '#' text(i)]; end; text=strmat(cell2mat(a),'#'); end; if exist('fmt')==0; fmt='%12.8f'; end; if exist('latex')==0; latex='nonee'; end; if exist('tle')~=0; if ~isempty(tle); tle=strmat(tle); end; else; tle=[]; end; NumLoops=1; if latex=='latex'; NumLoops=2; end; for NN=NumLoops:-1:1; if ~isempty(tle); disp ' '; disp ' '; ctr=0; if text(1,1)~=' '; spc=size(text,2); ctr=ctr+spc; fprintf(1,['%' num2str(spc) 's'],' '); end; blah=strmat(fmt); blah=replace(blah,blah=='.','s'); for i=1:size(tle,1); j=size(blah,1); if i