How to substitute numerical into symbol?

I need to substitute 0 for certain symbols in an calculation, however it is not doing what I want it to do. The function I have used are listed below as an example:
syms A1 A2 A3 A1_ A2_ A3_
a= A1*A1_+A2*A2_+A3*A3_*2
b= A1*A1_+A2*A2_+A3*A3_
c = subs(a, [A1*A1_,A2*A2_,A3*A3_],[0,0,0])
d = subs(b, [A1*A1_,A2*A2_,A3*A3_],[0,0,0])
but the ans I got is
c =
2*A3*A3_
d =
0
If the symbol on its own, the subs function will work. However, if the symbol is not on its own, such as (A3*A3_)^2 or (A3*A3_)*2, the ans will be similar to c which should be equal to 0 instead of 2*A3*A3_.
Is there anyway or any other function will make the substitution work?

Réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Question posée :

le 23 Fév 2013

Community Treasure Hunt

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

Start Hunting!

Translated by