1

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?

Mohsen Nosratinia
  • 9,844
  • 1
  • 27
  • 52
borapop
  • 23
  • 4

1 Answers1

0

A solution is

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

I dont know any other way.

Andreas H.
  • 5,557
  • 23
  • 32
  • that will do. May be you should just precise that the function handles `u` and `v` must be defined **before** this one (otherwise there will be no error at the time you define the function, but an error will pop up when you try to execute it). – Hoki Oct 06 '15 at 09:19