polynomial of x and y
39 次查看(过去 30 天)
显示 更早的评论
Input:
syms x y
p=x*y
q=y*x
Output:
p=x*y
q=x*y
In my code, x*y is not equal to y*x. I want q as y*x, not x*y. By default Matlab is treating x*y as y*x.
I need help with this.
Thank You.
1 个评论
Torsten
2024-11-5,10:36
MATLAB assumes commutativity of multiplication. Thus computations in general non-commutative rings or similar algebraic structures is not possible (at least to the best of my knowledge).
回答(1 个)
Anjaneyulu Bairi
2024-11-5,10:49
By default, MATLAB assumes all individual symbolic variables to be scalars, which inherently implies commutativity for scalar multiplication. Therefore, it is not possible to disable the commutative property for scalar symbolic variables in MATLAB.
Below MATLAB Answer might give you more information and there is a workaround mention which says define your symbols as matrices to remove commutative property.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Number Theory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!