minusf2 = @(x) -f2;
"This is working"
No. In fact, that does NOT work. That will simply not work. If f2 is a function handle, and you want to negate it, then you do this:
minusf2 = @(x) -f2(x);
So you evaluate f2, and then negate the result of f2.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!