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 ';'];
