passing a function to another function
Afficher commentaires plus anciens
Hi
I am trying to pass the following function "haar" to the function integral. I am getting the following error. plz suggest. thanks
function val = haar(x)
if ((0<=x) && (x<0.5))
val=1;
elseif ((0.5<= x) && (x < 1))
val =-1;
else
val =0;
end
end
EDU>> fhnadle=@haar;
EDU>> integral(fhnadle,0,1)
Operands to the || and && operators must be convertible to logical scalar values
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Discrete Multiresolution Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!