Hi, i need help about how to evaluate a diff result with values of variables, thank you

1 view (last 30 days)
Example
syms x y;
f1=(x.^3)+(x*y.^2)-(5);
df1y=diff(f1,y);
x=2;
y=0.25;
d=subs(df1y(x,y)) % Here is what im trying to do, but it doesn´t work apparently
hope you guys can help me to find out, thanks

Accepted Answer

Walter Roberson
Walter Roberson on 10 Mar 2018
d = subs(df1y)
However, I recommend using different variable names, such as
syms x y
f1 = (x.^3)+(x*y.^2)-(5);
df1y = diff(f1,y);
X = 2; %do not overwrite the symbolic names!
Y = 0.25;
d = subs(df1y, {x, y}, {X, Y})

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!