help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is octave slow and missing functions?


From: Søren Hauberg
Subject: Re: is octave slow and missing functions?
Date: Tue, 21 Aug 2007 11:13:37 +0200
User-agent: Thunderbird 1.5.0.12 (X11/20070604)

Peter Cloetens skrev:
function  u(varargin)
     if !nargin
         help u
         return
     else
         comm = '';
         for k = 1:nargin
             comm = [comm ' ' varargin{k}];
         end
         system(comm);
     endif
endfunction
You can simplify this function a bit:

function  u(varargin)
  if (!nargin)
    print_usage();
  else
    comm = sprintf("%s ", varargin{:});
    system(comm);
  endif
endfunction

Søren


reply via email to

[Prev in Thread] Current Thread [Next in Thread]