How do you substitute multiple variable in to an equation??

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

Réponses (2)

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;

Community Treasure Hunt

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

Start Hunting!

Translated by