I have a function I want to evaluate as an integral (using the function 'integral' that takes a function handle in it's arguments) that uses symbolic variables, but I want to create a matlabFunction (an anonymous function) in terms of just one of those symbolic variables, and have the others treated as constants.
s = (g^2*t^2 + 2*sin(a)*g*t*v + v^2)^(1/2)
S = matlabFunction(s)
S =
@(a,g,t,v)sqrt(v.^2+g.^2.*t.^2+g.*t.*v.*sin(a).*2.0)
But what I'd like to see is
@(t)sqrt(v.^2+g.^2.*t.^2+g.*t.*v.*sin(a).*2.0)