How to do matrix equality testing for symbols?

In the documentation I found this example.
A = [1+i 3 2 4+i];
B = [1 3+i 2 4+i];
A == B
The result is:
ans = 1x4 logical array
0 0 1 1
How can I make the == operator work for symbols? I tried below example:
syms a b [3 1] real
r1 = a*b';
r2 = b*a';
r1 == r2
and the result is:
Is it possible to compare symbol expressions?

Respuestas (1)

madhan ravi
madhan ravi el 17 de Jun. de 2020
syms a b [3 1] real
assume([a, b] > 0)
r1 = a*b';
r2 = b*a';
isAlways(r1 == r2) % indeed with a warning

La pregunta está cerrada.

Etiquetas

Preguntada:

el 17 de Jun. de 2020

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by