How do I isolate a letter in some equation?
1 view (last 30 days)
Show older comments
i.e. I have an equation: 2=2*x.^2; or 2=2*log(x).^2; How can I get the value of x in MatLab?
0 Comments
Accepted Answer
James Tursa
on 30 Nov 2016
Edited: James Tursa
on 30 Nov 2016
symvar is probably what you are looking for. E.g.,
>> eqn = '2=2*log(x).^2';
>> symvar(eqn)
ans =
'x'
EDIT:
To solve for x, make a symbolic expression that you want to equal 0, and pass that to the solve() function:
>> syms x
>> eqn = 2*log(x).^2-2;
>> solve(eqn)
ans =
exp(1)
1/exp(1)
More Answers (0)
See Also
Categories
Find more on Calculus 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!