- Timestamp:
- Nov 18, 2010, 11:21:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cell2tab.m
r107 r125 11 11 function Tabchar=cell2tab(Tabcell,separator) 12 12 Tabchar={};%default 13 [nx,ny]=size(Tabcell); 14 %determine width withcolumn(jtab) of each column 15 for jtab=1:ny 16 widthcolumn(jtab)=0;%default 17 for itab=1:nx% read line 18 if widthcolumn(jtab)<length(Tabcell{itab,jtab}) 19 widthcolumn(jtab)=length(Tabcell{itab,jtab}); 20 end 21 end 22 end 13 [ni,nj]=size(Tabcell); 14 15 %determine width of each column 16 widthcolumn=max(cellfun(@length,Tabcell)); 17 23 18 %justify table 24 for itab=1:n x19 for itab=1:ni 25 20 charchain=[]; 26 for jtab=1:n y% read line21 for jtab=1:nj% read line 27 22 textlu=Tabcell{itab,jtab}; 28 23 if widthcolumn(jtab)>length(textlu) … … 37 32 Tabchar(itab,1)={charchain}; 38 33 end 34 35 %nb : char(Tabchar(:,jtab)) gives directly a column with the blanks filled
Note: See TracChangeset
for help on using the changeset viewer.