[Top][All Lists]

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

[Octave-bug-tracker] [bug #36376] make nargin(fcn_name) work with anonym

From: anonymous
Subject: [Octave-bug-tracker] [bug #36376] make nargin(fcn_name) work with anonymous functions
Date: Thu, 03 May 2012 06:51:00 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0


                 Summary: make nargin(fcn_name) work with anonymous functions
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Do 03 Mai 2012 06:50:59 UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Tilman Schröder
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.4.3
        Operating System: Microsoft Windows




in Matlab, nargin is able to tell the number of arguments of anonymous
functions. In Octave, fcn_name has to be the name of an M-file, so nargin does
not work with anonymous functions:

octave:1> f = @(x,y) x^2 + y^2;
octave:2> nargin(f);
error: octave_base_value::convert_to_str_internal (): wrong type argument
`function handle'
error: nargin: FCN_NAME must be a string
octave:3> nargin('f');
error: nargin: invalid function
octave:6> nargin('test')
ans =  3

with the function M-file test.m.

It would be nice to have Octave return the correct number of input arguments
for anonymous functions and, (possibly), work with function handles directly,
not only with function names as strings.



Reply to this item at:


  Nachricht gesendet von/durch Savannah

reply via email to

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