Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KroneckerDelta in matlab

Tags:

matlab

delta

This link shows that there is a kronecker delta function in matlab. However:

>> help kroneckerDelta

    kroneckerDelta not found

I am using R2011b, so maybe this wasn't programmed into the toolkit yet?

EDIT:: It works in MuPad, just not in matlab...

.

like image 815
yankeefan11 Avatar asked Oct 23 '25 18:10

yankeefan11


1 Answers

The Kronecker delta returns 1 if j==k...

So you could simplify the expression with:

function d=kronDel(j,k)

d=j==k

end

Luckily, MATLAB represents booleans as (0,1)

like image 155
user2293601 Avatar answered Oct 26 '25 08:10

user2293601