view m-toolbox/sltpda/sltpda_fixvar.m @ 3:960fe1aa1c10
database-connection-manager
Add LTPDADatabaseConnectionManager implementation. Java code
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Mon, 05 Dec 2011 16:20:06 +0100 (2011-12-05)
parents
f0afece42f48
children
line source
+ − function cmd = sltpda_fixvar(cmd)
+ −
+ − % SLTPDA_FIXVAR replaces various unwanted characters in variable names.
+ − %
+ − % M Hewitson 11-04-07
+ − %
+ − % $Id: sltpda_fixvar.m,v 1.2 2007/04/29 12:52:00 hewitson Exp $
+ − %
+ −
+ − % some simple replacements
+ − cmd = strrep(cmd, ' ', '_');
+ − cmd = strrep(cmd, '-', '_');
+ − cmd = strrep(cmd, '/', '_');
+ − cmd = strrep(cmd, '.', '_');
+ −
+ − % check variable name doesn't begin with number - MATLAB doesn't like this
+ − if ~isempty(cmd)
+ − n = str2num(cmd(1));
+ − if ~isempty(n)
+ − if isreal(n)
+ − cmd = ['c' cmd];
+ − end
+ − end
+ − end
+ − % END