From help-octave-request Fri May 21 07:09:31 1993 Subject: How can I execute an external command from octave? From: che6yoh at sun dot leeds dot ac dot uk To: help-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 hasimoto at coral dot system dot nitech dot ac dot jp I am in Leeds Univ. U.K now. che6yoh at sun dot leeds dot ac dot uk 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