Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

basic code question

Asked by John on 22 Mar 2012

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);

0 Comments

John

Tags

Products

No products are associated with this question.

2 Answers

Answer by Matt Kindig on 22 Mar 2012
Accepted answer

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.

0 Comments

Matt Kindig
Answer by Wayne King on 22 Mar 2012

That is a function handle.

1 Comment

John on 22 Mar 2012

Thank you

Wayne King

Contact us