[Top][All Lists]

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

[Octave-bug-tracker] [bug #52568] str2func can't create a "lazy" handle

From: avlas
Subject: [Octave-bug-tracker] [bug #52568] str2func can't create a "lazy" handle to function which does not exist when str2func is executed
Date: Tue, 3 Apr 2018 10:24:33 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.10.0 Chrome/61.0.3163.140 Safari/537.36 Konqueror (WebEnginePart)

Follow-up Comment #10, bug #52568 (project octave):

Yes. Your intuition is correct. Result in Matlab 2017b:

1. cd /dir/without/foo.m (actually foo.m does not yet exist)

2. fh = @foo  %% no foo.m in current dir or loadpath

fh =

  function_handle with value:


3. fh ()      %% presumably an error

Undefined function or variable 'foo'.

4. cd /dir/with/foo.m (I create foo.m in current folder)

5. fh ()      %% calls function defined in /dir/with/foo.m?

this is function fh (just a dummy function that displays this msg)

6. cd /dir/without/foo.m

7. fh ()      %% error or calls previous foo.m?

'foo' is not found in the current folder or on the MATLAB path, but exists

Change the MATLAB current folder or add its folder to the MATLAB path.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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