fBasis = { @(x)sin(x) , @(x)sin(2*x) , @(x)sin(3*x) }
p = [2, 0, 0.5] end code
Your function would return the handle to a function that computes y = 2sin(x) + 0.5sin(3x).
How would you do something like this? I know it is not possible to multiply a function handle by a contant and for this poblem, I do not know what kinds of functions will be inputted in the array fBasis. Yes this is a small portion of a homework question but we are allowed to ask for help. A nudge in the right direction about how to start this would be very much appreciated.
Best Answer