help-octave
[Top][All Lists]
Advanced

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

How can I execute an external command from octave?


From: che6yoh
Subject: How can I execute an external command from octave?
Date: Fri, 21 May 93 13:06:30 BST

Dear Sirs,

I am trying to convert my MATLAB files to be used in OCTAVE.

I made some commands which are supported in MATLAB and are not
in OCTAVE, filter etc.

Because OCTAVE cannot deal with Vectors of strings,
I used length of string as a index of the vector
length=500*number_of_elements+string_length.
But abs can't be used to get ASCII codes or setstr isn't
supported.

I misunderstood I could use "!" as shell escape.
And I made a C program named setstr and setstr.m as follows.

Is there anyway in which external commands can be executed from
octave? 

I will appreciate your help very much.

Yours faithfully,

Yoshihiro Hashimoto
Dept. of Systems Eng., Nagoya Inst. of Tech. Japan
address@hidden
I am in Leeds Univ. U.K now.  address@hidden
The mail sent to Japanese address is automatically sent to
English address.
-----------------------------------------------------------
function y = setstr(x)
  f='setstrda';
  d=getenv("OCT");
  for i=1:100
    file=strcmb(d,f,num2str(i));
    if exist(file)==0,break;endif
  endfor
  z=x;
  save file z;
  command=sprintf("!setstr %s",file);
  eval(command);
  load file;
  y=z;
endfunction



reply via email to

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