how to get function value?
30 views (last 30 days)
Show older comments
Hi I want to evaluate function and its derivative at a=2 , how to do that?
syms a
b=2
e=0.9
q=1.2
g=2
k=3
d=0.5
f=(q*b*e/a-d*e)/((q^2)*(e^2)/a+2*e*g)
diff(f)
0 Comments
Accepted Answer
madhan ravi
on 3 Jun 2020
df(a) = diff(f)
df(2)
5 Comments
madhan ravi
on 3 Jun 2020
Edited: madhan ravi
on 3 Jun 2020
P.S: You have some troubles with copying.
f(a) = (q*b*e/a-d*e)/((q^2)*(e^2)/a+2*e*g)
f(2)
More Answers (1)
David Hill
on 3 Jun 2020
syms a;
b=2;
e=0.9;
q=1.2;
g=2;
k=3;
d=0.5;
f=(q*b*e/a-d*e)/((q^2)*(e^2)/a+2*e*g);
df=diff(f);
fvals=eval(subs(f,1:10));%evaluate f from 1:10 (if you want actual symetric value eleminate the eval function
dfvals=eval(subs(df,1:10));
3 Comments
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!