Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to check if a variable is a function handle?
Replies: 4   Last Post: Jul 18, 2013 9:38 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,674
Registered: 2/7/05
Re: How to check if a variable is a function handle?
Posted: Jul 18, 2013 6:25 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 7/18/2013 5:16 AM, Rui wrote:
> Is there a way to check if variable is a function handle? I couldn't find any reference on Mathworks' is* page[1].
>
>
> Thanks in advance,
> Rui Maciel
>
> [1] http://www.mathworks.com/help/matlab/ref/is.html
>


there should be a special function for this. But I trust you
searched and could not find one that is build in. In this case,
you can also do:


--------------------
g=@(x) x;
if strcmp(class(g),'function_handle'),'yup',end
--------------------

ans =

yup




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.