source: trunk/src/uvmat_doc/FUNCTIONS_DOC/stra2num.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.7 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 stra2num</title>
6  <meta name="keywords" content="stra2num">
7  <meta name="description" content="'stra2num': transform letters (a, b, c) or numerical strings ('1','2'..) to the corresponding numbers">
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; stra2num.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>stra2num
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>'stra2num': transform letters (a, b, c) or numerical strings ('1','2'..) to the corresponding numbers</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 numres=stra2num(str) </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">'stra2num': transform letters (a, b, c) or numerical strings ('1','2'..) to the corresponding numbers
31--------------------------------------------
32  function numres=stra2num(str)
33
34 OUTPUT:
35 numres: number (double)
36
37 INPUT:
38 str: string corresponding to a number or a letter 'a' 'b',.., otherwise the output is empty
39
40 see also <a href="num2stra.html" class="code" title="function str=num2stra(num,nom_type,index);">num2stra</a>, <a href="name_generator.html" class="code" title="function [filename,idetect,num_i1_out,num_j1_out,num_i2_out,num_j2_out,subdir_out]=name_generator(filebase,num_i1,num_j1,ext,nom_type,comp_input,num_i2,num_j2,subdir);">name_generator</a>, <a href="name2display.html" class="code" title="function [RootPath,RootFile,field_count,str2,str_a,str_b,ext,nom_type,subdir]=name2display(fileinput)">name2display</a></pre></div>
41
42<!-- crossreference -->
43<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
44This function calls:
45<ul style="list-style-image:url(../matlabicon.gif)">
46</ul>
47This function is called by:
48<ul style="list-style-image:url(../matlabicon.gif)">
49<li><a href="civ.html" class="code" title="function varargout = civ(varargin)">civ</a>  'civ': function associated with the interface 'civ.fig' for PIV, spline interpolation and stereo PIV (patch)</li><li><a href="civ_3D.html" class="code" title="function varargout = civ_3D(varargin)">civ_3D</a>        'civ_3D': function associated with the interface 'civ_3D.fig' for PIV in volume</li><li><a href="name_generator.html" class="code" title="function [filename,idetect,num_i1_out,num_j1_out,num_i2_out,num_j2_out,subdir_out]=name_generator(filebase,num_i1,num_j1,ext,nom_type,comp_input,num_i2,num_j2,subdir);">name_generator</a>   'name_generator': creates a file name from a root name and indices.</li><li><a href="series.html" class="code" title="function varargout = series(varargin)">series</a> 'series': master function associated to the GUI series.m for analysis field series</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>
50<!-- crossreference -->
51
52
53<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
54<div class="fragment"><pre>0001 <span class="comment">%'stra2num': transform letters (a, b, c) or numerical strings ('1','2'..) to the corresponding numbers</span>
550002 <span class="comment">%--------------------------------------------</span>
560003 <span class="comment">%  function numres=stra2num(str)</span>
570004 <span class="comment">%</span>
580005 <span class="comment">% OUTPUT:</span>
590006 <span class="comment">% numres: number (double)</span>
600007 <span class="comment">%</span>
610008 <span class="comment">% INPUT:</span>
620009 <span class="comment">% str: string corresponding to a number or a letter 'a' 'b',.., otherwise the output is empty</span>
630010 <span class="comment">%</span>
640011 <span class="comment">% see also num2stra, name_generator, name2display</span>
650012
660013 <a name="_sub0" href="#_subfunctions" class="code">function numres=stra2num(str)</a>
670014 numres=[]; <span class="comment">%default</span>
680015 <span class="keyword">if</span> double(str) &gt;= 48 &amp; double(str) &lt;= 57 <span class="comment">% = test for number strings</span>
690016     numres=str2num(str);
700017 <span class="keyword">elseif</span> double(str) &gt;= 65 &amp; double(str) &lt;= 90 <span class="comment">% test on ascii code for capital letters</span>
710018     numres=double(str)-64; <span class="comment">%change capital letters to corresponding number in the alphabet</span>
720019 <span class="keyword">elseif</span> double(str) &gt;= 97 &amp; double(str) &lt;= 122 <span class="comment">% test on ascii code for small letters</span>
730020     numres=double(str)-96; <span class="comment">%change small letters to corresponding number in the alphabet</span>
740021 <span class="keyword">end</span></pre></div>
75<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>
76</body>
77</html>
Note: See TracBrowser for help on using the repository browser.