You may want to do element-wise (array) multiplication rather than matrix multiplication.
Try this:
@(x)x.*matrix
Note the (.*) element-wise multiplication operator.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!