%'cell2tab': transform a Matlab cell in a character array suitable for display in a table % INPUT: % Tabcell: (nx,ny) cell table, for nx lines % separator: character used for separating displayed columns function Tabchar=cell2tab(Tabcell,separator) Tabchar={};%default [nx,ny]=size(Tabcell); %determine width withcolumn(jtab) of each column for jtab=1:ny widthcolumn(jtab)=0;%default for itab=1:nx% read line if widthcolumn(jtab)length(textlu) blankstr=char(32*ones(1,widthcolumn(jtab)-length(textlu))); textlu=[textlu blankstr]; end if ~isempty(charchain) textlu=[separator textlu]; end charchain=[charchain textlu]; end %Tabchar(itab)={charchain}; Tabchar(itab,1)={charchain}; end