Search code examples
matlabfunction-handle

Multipy function handles matlab


I need to multipy two function handles and get function handle as a result. e.g. :

u = @(x) x + 2;
v = @(x) 2*x + 1;
y = u * g;

How to do this?


Solution

  • A solution is

    y = @(x)( u(x).*v(x) );
    

    I dont know any other way.