Is it possible to simplify symbolic expressions with known relations
1 view (last 30 days)
Show older comments
Say I have some arbitrary symbolic expressions
syms x1 x2
% x1*x2 == 1
a = x1*x2 + x1*x2;
b = 2*a
If it is known that x1 * x2 == 1 is it possible to have matlab actively simplify based off of that relation so that b returns the answer 4 without the use of subs?
0 Comments
Accepted Answer
Star Strider
on 18 Mar 2019
syms x1 x2
assume(x1*x2 == 1)
a = x1*x2 + x1*x2;
b = 2*a
producing:
b =
4*x1*x2
2 Comments
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!