source: trunk/src/uvmat_doc/FUNCTIONS_DOC/cell2tab.html @ 37

Last change on this file since 37 was 37, checked in by sommeria, 14 years ago

create_grid.fig ,
uvmat_doc and all the included files added

File size: 5.5 KB
Line 
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 &copy; 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> &gt;  <a href="index.html">.</a> &gt; cell2tab.m</div>
16
17<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
18<td align="right"><a href="index.html">Index for .&nbsp;<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>
37This function calls:
38<ul style="list-style-image:url(../matlabicon.gif)">
39</ul>
40This 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>
480002 <span class="comment">% INPUT:</span>
490003 <span class="comment">% Tabcell: (nx,ny) cell table, for nx lines</span>
500004 <span class="comment">% separator: character used for separating displayed columns</span>
510005 <a name="_sub0" href="#_subfunctions" class="code">function Tabchar=cell2tab(Tabcell,separator) </a>
520006 Tabchar={};<span class="comment">%default</span>
530007 [nx,ny]=size(Tabcell);
540008 <span class="comment">%determine width withcolumn(jtab) of each column</span>
550009 <span class="keyword">for</span> jtab=1:ny
560010     widthcolumn(jtab)=0;<span class="comment">%default</span>
570011     <span class="keyword">for</span> itab=1:nx<span class="comment">% read line</span>
580012         <span class="keyword">if</span> widthcolumn(jtab)&lt;length(Tabcell{itab,jtab})
590013             widthcolumn(jtab)=length(Tabcell{itab,jtab});
600014         <span class="keyword">end</span>
610015     <span class="keyword">end</span>
620016 <span class="keyword">end</span>
630017 <span class="comment">%justify table</span>
640018 <span class="keyword">for</span> itab=1:nx   
650019     charchain=[];         
660020     <span class="keyword">for</span> jtab=1:ny<span class="comment">% read line</span>
670021         textlu=Tabcell{itab,jtab};
680022         <span class="keyword">if</span> widthcolumn(jtab)&gt;length(textlu)
690023             blankstr=char(32*ones(1,widthcolumn(jtab)-length(textlu)));
700024             textlu=[textlu blankstr];
710025         <span class="keyword">end</span>
720026         <span class="keyword">if</span> ~isempty(charchain)
730027             textlu=[separator textlu];
740028         <span class="keyword">end</span>
750029         charchain=[charchain textlu];
760030     <span class="keyword">end</span>
770031     <span class="comment">%Tabchar(itab)={charchain};</span>
780032     Tabchar(itab,1)={charchain};
790033 <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> &copy; 2003</address>
81</body>
82</html>
Note: See TracBrowser for help on using the repository browser.