diff m-toolbox/sltpda/sltpda_buildCmd.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/sltpda/sltpda_buildCmd.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,42 @@
+function cmd = sltpda_buildCmd(inames, onames, params, fcn)
+% LTPDA_BUILDCMD Build command string for I/O and paramds and fcn.
+% 
+% usage: cmd = ltpda_buildCmd(inames, onames, params, fcn)
+% 
+% M Hewitson 04-05-07
+% 
+% $Id: sltpda_buildCmd.m,v 1.1 2007/05/06 12:17:38 hewitson Exp $
+% 
+
+cmd = '';
+
+% add outputs
+if ~isempty(onames)
+  cmd = [cmd '['];
+  for k=1:length(onames)
+    cmd = [cmd onames{k} ','];
+  end
+  cmd = [cmd(1:end-1) ']'];
+  cmd = [cmd ' = '];
+end
+
+% add fcn name
+cmd = [cmd fcn];
+
+% add inputs
+cmd = [cmd '('];
+if ~isempty(inames)
+  for k=1:length(inames)
+    cmd = [cmd inames{k} ','];
+  end
+end
+
+% add parameters
+if ~isempty(params)
+  cmd = [cmd params];
+else
+  cmd = cmd(1:end-1);
+end
+
+cmd = [cmd ')'];
+cmd = [cmd ';'];