Behavior of subs() function in Symbolic Math Toolbox
Afficher commentaires plus anciens
Dear MATLAB Central members,
I would like to ask a behavior of subs() in Symbolic Math Toolbox (R2016b, Windows 64 bit, OS: Windows 7).
Here is an example.
syms a b aM bM
aM=sym([2 3;4 5]);
bM=sym([6 7;8 9]);
s_temp=a*b;
>> s_temp=subs(s_temp,a,'aM')
s_temp =
aM*b
>> s_temp=subs(s_temp,b,'bM')
s_temp =
aM*bM
>> subs(s_temp)
ans =
[ 12, 21]
[ 32, 45]
which is same as
>> aM.*bM
ans =
[ 12, 21]
[ 32, 45]
but what I like to get the result from subs(s_temp) is a result of
>> aM*bM
ans =
[ 36, 41]
[ 64, 73]
Can I get this result using subs function, or should I do something else?
Thank you in advance for your help.
Regards,
Kosuke
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 19 Sep 2017
1 vote
No. The symbolic toolbox treats all unassigned variables as scalar and that is not possible to change (it is the behavior of the symbolic engine itself)
1 commentaire
Kosuke
le 19 Sep 2017
Catégories
En savoir plus sur 式の操作と単純化 dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!