basic code question

Hello
What does the '@' symbol do in this equation?
Is the first (z) multiplied the e^(...)?
thank you
% Gaussian kernel function
kerf=@(z)exp(-z.*z/2)/sqrt(2*pi);

 Respuesta aceptada

Matt Kindig
Matt Kindig el 22 de Mzo. de 2012

0 votos

It is a function handle. It means that you are defining an anonymous function 'kerf' that takes z as an input. The actual equation is just
exp(-z.*z/2)/sqrt(2*pi)
The User Guide has a pretty good write-up about these. Search "anonymous function" in the Help.

Más respuestas (1)

Wayne King
Wayne King el 22 de Mzo. de 2012

0 votos

That is a function handle.

Categorías

Más información sobre Programming Utilities en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 22 de Mzo. de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by