MATLAB: Derivative at various points in symbolic math toolbox

derivativesymbolicSymbolic Math Toolbox

let say i have a vector.
A=[1 2 4 6]
now i am declaring a function using symbolic toolbox
syms x
f=x^2
how do you evaluate f at every elements of A?

Best Answer

A = [1 2 4 6];
syms x
f(x) = x^2
sol = f(A)
gives:
f(x) =
x^2
sol =
[ 1, 4, 16, 36]