MATLAB: How to isolate a letter in some equation

equationMATLAB

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?

Best Answer

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)