Matlab is symbolic

I am trying to compare two simple expressions using the Matlab symbolic toolbar. For some reason, the code returns 0. Any idea?

syms a b c
A = (a/b)^c
B = a^c/b^c
isequal(A,B)
+4
source share
2 answers

In general, what you wrote is incorrect, with the right “assumptions” this becomes true: for example, if it cis an integer, you can trick MATLAB into the extension A

clc; clear all;
syms a 
syms b 
syms c integer
A = (a/b)^c;
B = simplify((a^c)/(b^c));
disp(isequal(A,B));
disp(A);
disp(B);

1

a ^ s / b ^ s
a ^ x / b ^ s

0
source

MATLAB seems to hardly say that the two expressions are the same when (potentially) fractional exponents are involved.

, , , , c , , Math.SE jodag, .

, , simplify B, , .

syms a b c
A = (a/b)^c
B = a^c/b^c
isequal(A,simplify(B,'step',4))

- , , MATLAB, . , , , . , "", , .

+1

Source: https://habr.com/ru/post/1692509/


All Articles