Mercurial > hg > ltpda
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 function cmd = sltpda_buildCmd(inames, onames, params, fcn) | |
2 % LTPDA_BUILDCMD Build command string for I/O and paramds and fcn. | |
3 % | |
4 % usage: cmd = ltpda_buildCmd(inames, onames, params, fcn) | |
5 % | |
6 % M Hewitson 04-05-07 | |
7 % | |
8 % $Id: sltpda_buildCmd.m,v 1.1 2007/05/06 12:17:38 hewitson Exp $ | |
9 % | |
10 | |
11 cmd = ''; | |
12 | |
13 % add outputs | |
14 if ~isempty(onames) | |
15 cmd = [cmd '[']; | |
16 for k=1:length(onames) | |
17 cmd = [cmd onames{k} ',']; | |
18 end | |
19 cmd = [cmd(1:end-1) ']']; | |
20 cmd = [cmd ' = ']; | |
21 end | |
22 | |
23 % add fcn name | |
24 cmd = [cmd fcn]; | |
25 | |
26 % add inputs | |
27 cmd = [cmd '(']; | |
28 if ~isempty(inames) | |
29 for k=1:length(inames) | |
30 cmd = [cmd inames{k} ',']; | |
31 end | |
32 end | |
33 | |
34 % add parameters | |
35 if ~isempty(params) | |
36 cmd = [cmd params]; | |
37 else | |
38 cmd = cmd(1:end-1); | |
39 end | |
40 | |
41 cmd = [cmd ')']; | |
42 cmd = [cmd ';']; |