octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #51586] Creating method handle fails using str


From: Kai Torben Ohlhus
Subject: [Octave-bug-tracker] [bug #51586] Creating method handle fails using str2func
Date: Fri, 28 Jul 2017 18:50:52 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36

Update of bug #51586 (project octave):

                  Status:                    None => Patch Submitted        
             Assigned to:                    None => siko1056               

    _______________________________________________________

Follow-up Comment #2:

Confirmed for classdef as well, before applying the patch to the dev branch:

FOLDER CLASS:


>> p = polynomial ([1 0 -1])
p =

 1 - X ^ 2

>> roots (p)
error: Invalid call to roots.  Correct usage is:

 -- roots (C)

Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the address@hidden
mailing list.


CLASSDEF:


>> p = polynomial2 ([1 0 -1]);
>> disp (p)
 1 - X ^ 2
>> fh = str2func ("@polynomial2/disp")
error: Invalid call to disp.  Correct usage is:

 -- disp (X)

Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the address@hidden
mailing list.


Afterwards:

FOLDER CLASS:


>> p = polynomial ([1 0 -1])
p =

 1 - X ^ 2

>> roots (p)
ans =

  -1
   1

>> fh = str2func ("@polynomial/roots")
fh = @@polynomial/roots
>> fh (p)
ans =

  -1
   1



CLASSDEF:


>> p = polynomial2 ([1 0 -1]);
>> disp (p)
 1 - X ^ 2
>> fh = str2func ("@polynomial2/disp")
fh = @@polynomial2/disp
>> fh (p)
 1 - X ^ 2


I used the polynomial / polynomial2 classes from the examples directory.

Is this functionality Matlab compatible? I have no chance to check before
Monday. I think we should add a regression test to the patch and then it is
ready to be uploaded soon.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51586>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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