MATLAB Answers

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

4 views (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

  0 Comments

Sign in to comment.

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)

Sign in to answer this question.