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

writing a formula in matlab

Asked by John on 22 Mar 2012

Hello,

I'm trying to write a function in matlab.

I have an example:

A gaussian kernel is

% Gaussian kernel function
%kerf=@(z)exp(-z.*z/2)/sqrt(2*pi);

How would you code an epanechnikov kernel?

I have the equation for both here? http://dl.dropbox.com/u/54057365/All/kernel1.JPG

How would you deal with the absolute value of t being less than or equal to 1?

Thank for your help

John

0 Comments

John

Tags

Products

No products are associated with this question.

1 Answer

Answer by the cyclist on 22 Mar 2012
Accepted answer
kerf=@(z) (3/4)*(1-z.^2).*(abs(z)<=1)

0 Comments

the cyclist

Contact us