How to use kroneckerdelta in programming
Mostrar comentarios más antiguos
I want to use the Kroneckerdelta function in my programming.I also check the syntax for it. It is given as kroneckerDelta(m,n).But when i used this syntax in my programming it is showing error Undefined function 'DiracDelta' for input arguments of type 'double'.What does it mean?
2 comentarios
KSSV
el 16 de Dic. de 2016
What version of MATLAB you are using? Does help Kroneckerdelta gives details about the function?
John D'Errico
el 16 de Dic. de 2016
See my answer...
Respuestas (2)
John D'Errico
el 16 de Dic. de 2016
You are doing this:
kroneckerDelta(2,3)
Undefined function 'kroneckerDelta' for input arguments of type 'double'.
As you see, MATLAB fails to work, even though I have the symbolic TB, in the current release. Why does it fail? Because I called it with double precision arguments. That function is part of the symbolic TB. In order for it to work, the arguments (at least one of them) must be symbolic.
kroneckerDelta(sym(2),3)
ans =
0
You can also write your own function, without syms...
function d = kronDel(j,k)
if j == k
d = 1;
else
d = 0;
end
1 comentario
YOGESHWARI PATEL
el 16 de Dic. de 2016
Categorías
Más información sobre Special Functions en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!