help-octave
[Top][All Lists]
Advanced

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

Re: Get function arguments number


From: Jaroslav Hajek
Subject: Re: Get function arguments number
Date: Mon, 3 Jan 2011 16:22:03 +0100

On Sun, Jan 2, 2011 at 11:34 AM, gianvito <address@hidden> wrote:
> Thanks for you reply...
> but args.length ( ) returns the number of the arguments passed to the C++
> function ...
>
> I need to know how many arguments does the function that i pass as argument
> accepts.
> So, let's think I define a function in the octave prompt:
> F = @(x,y) x + y;
>
> Then I call the compiled C++ function:
> testCfunction(F);
>
> well...I'd like to know in C++ how many arguments has the function F (in
> this case two).
>
> So something as:
> octave_function func = args(0).function_value();
> func.arguments_number( );         // I need this function
>
> Is this possible? Thanks
>

For m-file funcs, you can use octave_user_function::parameter_list.
Compiled functions don't expose this information in any way (it
doesn't even make sense).


reply via email to

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