comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Anonymous Math Functions in IDL like Matlab
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Anonymous Math Functions in IDL like Matlab [message #75310 is a reply to message #75264] Fri, 25 February 2011 16:50 Go to previous messageGo to previous message
Ammar Yusuf is currently offline  Ammar Yusuf
Messages: 36
Registered: October 2010
Member
On Feb 25, 11:16 am, Michael Galloy <mgal...@gmail.com> wrote:
> On 2/24/11 8:32 pm, nata wrote:
>
>> I am just curious. What does the expression "sqrt = @(x) x.^2" means ?
>
> It's a lambda function, or anonymous function, a way of specifying a
> function without naming it, i.e., to use inline only once.
>
> For example, see how Python does this:
>
>   http://diveintopython.org/power_of_introspection/lambda_func tions.html
>
> Mike
> --www.michaelgalloy.com
> Research Mathematician
> Tech-X Corporation

That's pretty cool. I did not know that.

I know in Matlab what happens is it creates a function say sqrt. In
Matlab
you can then call sqrt(4) and it would return 2.

I found this very helpful instead of making a .m file for each
polynomial function
that I was doing for my homework.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Plotimage and non-byte images
Next Topic: Re: Read ASCII File with tab seperator

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:23:44 PDT 2025

Total time taken to generate the page: 0.00414 seconds