Suppose f and g are function_handles, try to define f+g,f-g,f*g and f/g.
e.g.
if f = @(x)x and g = @(x)x+1
then
f+g = @(x)2*x+1
f-g = @(x)-1
f*g = @(x)x*(x+1)
f/g = @(x)x/(x+1)
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers58
Suggested Problems
-
Find the peak 3n+1 sequence value
2568 Solvers
-
Renaming a field in a structure array
1578 Solvers
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1993 Solvers
-
Flip the main diagonal of a matrix
907 Solvers
-
Circular Primes (based on Project Euler, problem 35)
652 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!