How do you substitute multiple variable in to an equation??
4 views (last 30 days)
Show older comments
I have a simple case where
syms x y;
f= x+y;
how shoud I substitute x and y seperately??
just like subs function: subs(f, 1) which only substitutes y in this case
0 Comments
Answers (2)
Walter Roberson
on 10 Mar 2020
Edited: Walter Roberson
on 10 Mar 2020
subs(f, variable_name, new_value)
0 Comments
Star Strider
on 10 Mar 2020
Symbolic functions are possible beginning with R2012a (if I remember correctly).
This should do what you want:
syms x y
f(x,y) = x+y;
A numeric equivalent would be:
f = @(x,y) x + y;
0 Comments
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!