polynomial of x and y

조회 수: 2 (최근 30일)
Thrupthi Jain
Thrupthi Jain 2024년 11월 5일
답변: Anjaneyulu Bairi 2024년 11월 5일
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
Torsten 2024년 11월 5일
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
Anjaneyulu Bairi 2024년 11월 5일
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.

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by