passing a function to another function
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Discrete Multiresolution Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!