MATLAB Answers

derivative at various points in symbolic math toolbox

1 view (last 30 days)
Mesbahose Salekeen
Mesbahose Salekeen on 2 Oct 2019
Answered: Stephan on 2 Oct 2019
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?

  0 Comments

Sign in to comment.

Accepted Answer

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

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.