help-octave
[Top][All Lists]
Advanced

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

feval call to a subfunction fails when it is in a subfunction


From: Sidney Markowitz
Subject: feval call to a subfunction fails when it is in a subfunction
Date: Thu, 01 Oct 2009 14:40:36 +1300
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

I'm new to using Octave and don't know if this is a bug in my code, a bug in Octave, or something wrong with my installed copy of Octave.

The following code demonstrates the problem. The first feval, in the main function, works and the result is displayed. The other feval, inside the subfunction switchyard2, gets an error in line 9
 error: feval: function `mysin' not found

I am using Octave version 3.2.2 compiled on my Macbook under MacOS 10.6.1, downloaded and built from Macports. I put the following text in a file named ./switchyard.m and invoked it in the Octave command line by typing switchyard(10)

Do others get the same results? Is there a bug in my example code? Is it a bug in Octave?

function y = switchyard(x)
   z = feval('mysin', x);
   disp(z);
   y = switchyard2(x);
  return;
endfunction

function y = switchyard2(x)
  y = feval('mysin', x);
  return;
endfunction

function y= mysin(x)
  y = sin(x);
 return;
endfunction


reply via email to

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