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?

Answers (1)

syms a b [3 1] real
assume([a, b] > 0)
r1 = a*b';
r2 = b*a';
isAlways(r1 == r2) % indeed with a warning

This question is closed.

Asked:

on 17 Jun 2020

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!