How do you substitute multiple variable in to an equation??
Afficher commentaires plus anciens
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)
Walter Roberson
le 10 Mar 2020
Modifié(e) : Walter Roberson
le 10 Mar 2020
subs(f, variable_name, new_value)
Star Strider
le 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;
Catégories
En savoir plus sur Linear Algebra dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!