I can create a MATLAB function from a symbolic expression using the following method:
>> syms a b c>> symExp = a .* b + c>> scalarFcn = matlabFunction(symExp)scalarFcn = function_handle with value: @(a,b,c)c+a.*b
I would like a programmatic way to turn this symbolic expression into a vector function of the vector [a, b, c] like this:
>> vectorFcn = @(theta) theta(1) .* theta(2) + theta(3)
Is this possible?
Best Answer