1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/REC-html40/loose.dtd"> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <title>Description of cell2tab</title> |
---|
6 | <meta name="keywords" content="cell2tab"> |
---|
7 | <meta name="description" content="'cell2tab': transform a Matlab cell in a character array suitable for display in a table"> |
---|
8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
9 | <meta name="generator" content="m2html © 2003 Guillaume Flandin"> |
---|
10 | <meta name="robots" content="index, follow"> |
---|
11 | <link type="text/css" rel="stylesheet" href="../m2html.css"> |
---|
12 | </head> |
---|
13 | <body> |
---|
14 | <a name="_top"></a> |
---|
15 | <div><a href="../index.html">Home</a> > <a href="index.html">.</a> > cell2tab.m</div> |
---|
16 | |
---|
17 | <!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td> |
---|
18 | <td align="right"><a href="index.html">Index for . <img alt=">" border="0" src="../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>cell2tab |
---|
21 | </h1> |
---|
22 | |
---|
23 | <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
24 | <div class="box"><strong>'cell2tab': transform a Matlab cell in a character array suitable for display in a table</strong></div> |
---|
25 | |
---|
26 | <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
27 | <div class="box"><strong>function Tabchar=cell2tab(Tabcell,separator) </strong></div> |
---|
28 | |
---|
29 | <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
30 | <div class="fragment"><pre class="comment">'cell2tab': transform a Matlab cell in a character array suitable for display in a table |
---|
31 | INPUT: |
---|
32 | Tabcell: (nx,ny) cell table, for nx lines |
---|
33 | separator: character used for separating displayed columns</pre></div> |
---|
34 | |
---|
35 | <!-- crossreference --> |
---|
36 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
37 | This function calls: |
---|
38 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
39 | </ul> |
---|
40 | This function is called by: |
---|
41 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
42 | <li><a href="editxml.html" class="code" title="function varargout = editxml(varargin)">editxml</a> 'editxml': function for editing xml files using a xml schema (associated with the GUI editxml.fig)</li><li><a href="geometry_calib.html" class="code" title="function varargout = geometry_calib(varargin)">geometry_calib</a> 'geometry_calib': performs geometric calibration from a set of reference points</li><li><a href="get_field.html" class="code" title="function varargout = get_field(varargin)">get_field</a> 'get_field': display variables and attributes from a Netcdf file, and plot selected fields</li><li><a href="plot_text.html" class="code" title="function hdisplay=plot_text(FieldData,hdisplay_in)">plot_text</a> 'plot_text': function for displaying the content of a Matlab structure in a figure</li><li><a href="probe_calib.html" class="code" title="function varargout = probe_calib(varargin)">probe_calib</a> 'probe_calib': performs geometric calibration from a set of reference points</li><li><a href="uvmat.html" class="code" title="function varargout = uvmat(varargin)">uvmat</a> 'uvmat': function associated with the GUI 'uvmat.fig' for images and data field visualization</li></ul> |
---|
43 | <!-- crossreference --> |
---|
44 | |
---|
45 | |
---|
46 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
47 | <div class="fragment"><pre>0001 <span class="comment">%'cell2tab': transform a Matlab cell in a character array suitable for display in a table</span> |
---|
48 | 0002 <span class="comment">% INPUT:</span> |
---|
49 | 0003 <span class="comment">% Tabcell: (nx,ny) cell table, for nx lines</span> |
---|
50 | 0004 <span class="comment">% separator: character used for separating displayed columns</span> |
---|
51 | 0005 <a name="_sub0" href="#_subfunctions" class="code">function Tabchar=cell2tab(Tabcell,separator) </a> |
---|
52 | 0006 Tabchar={};<span class="comment">%default</span> |
---|
53 | 0007 [nx,ny]=size(Tabcell); |
---|
54 | 0008 <span class="comment">%determine width withcolumn(jtab) of each column</span> |
---|
55 | 0009 <span class="keyword">for</span> jtab=1:ny |
---|
56 | 0010 widthcolumn(jtab)=0;<span class="comment">%default</span> |
---|
57 | 0011 <span class="keyword">for</span> itab=1:nx<span class="comment">% read line</span> |
---|
58 | 0012 <span class="keyword">if</span> widthcolumn(jtab)<length(Tabcell{itab,jtab}) |
---|
59 | 0013 widthcolumn(jtab)=length(Tabcell{itab,jtab}); |
---|
60 | 0014 <span class="keyword">end</span> |
---|
61 | 0015 <span class="keyword">end</span> |
---|
62 | 0016 <span class="keyword">end</span> |
---|
63 | 0017 <span class="comment">%justify table</span> |
---|
64 | 0018 <span class="keyword">for</span> itab=1:nx |
---|
65 | 0019 charchain=[]; |
---|
66 | 0020 <span class="keyword">for</span> jtab=1:ny<span class="comment">% read line</span> |
---|
67 | 0021 textlu=Tabcell{itab,jtab}; |
---|
68 | 0022 <span class="keyword">if</span> widthcolumn(jtab)>length(textlu) |
---|
69 | 0023 blankstr=char(32*ones(1,widthcolumn(jtab)-length(textlu))); |
---|
70 | 0024 textlu=[textlu blankstr]; |
---|
71 | 0025 <span class="keyword">end</span> |
---|
72 | 0026 <span class="keyword">if</span> ~isempty(charchain) |
---|
73 | 0027 textlu=[separator textlu]; |
---|
74 | 0028 <span class="keyword">end</span> |
---|
75 | 0029 charchain=[charchain textlu]; |
---|
76 | 0030 <span class="keyword">end</span> |
---|
77 | 0031 <span class="comment">%Tabchar(itab)={charchain};</span> |
---|
78 | 0032 Tabchar(itab,1)={charchain}; |
---|
79 | 0033 <span class="keyword">end</span></pre></div> |
---|
80 | <hr><address>Generated on Fri 13-Nov-2009 11:17:03 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
81 | </body> |
---|
82 | </html> |
---|