MATLAB: Substitute an array of number for a symbolic variable

MATLABsymbolic

Hi,
I have:
syms x y
f=x^3+y^3+3x^2+2y^2+9
fx=diff(f,x)
now, I'd like to substitute these two vectors of x and y values into the expression fx.
x=[1,2,3,4,5]
y=[6,7,8,9,10]
How do I do that with the subs command? If I can't do that with the subs command, what do you recommend?
David.

Best Answer

subs(fx, {x, y}, {[1,2,4,5,6}, [6,7,8,9,10]})
This syntax is documented relatively far down in the examples.
Related Question