symbolic logical operation can't get right answer
Show older comments
Hello,
I have
syms a b c
aa=(a==b)+c
bb=eval(subs(aa,[a,b,c], [1/5, 0, 1051/10000]))
My expected result is
aa=(a==b)+c
bb=
0.1051
However, the actual result is
aa =
a + c == b + c
bb =
logical
0
In my opinion, (a==b) should be computed first. The logical result then is added to c. Finally I can get a double number 0.1051. However, the actual result is not what I want.
How did that happen? What can I do to solve this problem?
Accepted Answer
More Answers (0)
Categories
Find more on Common Operations 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!