[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: is octave slow and missing functions?
From: |
Peter Cloetens |
Subject: |
Re: is octave slow and missing functions? |
Date: |
Tue, 21 Aug 2007 10:59:34 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060909) |
David Bateman wrote:
Przemek Klosowski wrote:
I got this response re. octave as alternative to matlab:
I should make a note about this; I use octave a lot at home as it's
rather cheap (free). It can be an alternative in some instances but
there are some limitations with it:
....
* there is no GUI (and the CLI lacks the very useful !-command)
Opinionated ignorance. Matlab uses ! for external shell commands, so
for instance '!ls' prints the current directory listing. In Octave
you'd just do 'ls'. I guess he has a point---Octave does lack the !
command (nb, in Octave ! is the logical negation operator).
_______________________________________________
Tell them to use "system" instead that exists on both matlab and windows
and leave the "!" for its traditional use as the NOT operator....
D.
I completely agree that "!" should be used for the NOT operator. This is
one of the annoying matlab particularities.
In order to make the system calls easier we use the small octave command
"u" given below.
In this case it is possible to type simply:
u top
for example.
This is the same solution as in the instrument control software "spec"
from CSS.
Peter
Lines in .octaverc:
___________________
if (exist('u') == 2)
# to be able to call unix commands easily a la spec: u top
mark_as_command u
end
Content of u.m :
________________
## Copyright (C) 2006 P. Cloetens
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
## u unix-command
## u('unix-command')
## Author: P. Cloetens <address@hidden>
##
## 2006-07-27 P. Cloetens <address@hidden>
## * Initial revision
## PKG_ADD: mark_as_command u
function u(varargin)
if !nargin
help u
return
else
comm = '';
for k = 1:nargin
comm = [comm ' ' varargin{k}];
end
system(comm);
endif
endfunction