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) Related SolutionsMATLAB: Display symbolic expressions as rational. syms xsympref('FloatingPointOutput',true);(1/2)*(3*x^2)ans = sympref('FloatingPointOutput',false);(1/2)*(3*x^2)ans = MATLAB: How isolate v = 10;x = dec2bin(v, 15); % '000000000001010'y = transpose(reshape(x, 5, 3)); % ['00000'; '00000'; '01010']bin2dec(y) % [0, 0, 10]Or without the slow step over the binary string:floor(rem(v ./ [1, 32, 32*32], 32)) Related QuestionHeaviside and sign functionIsolate a variableDerivative of a FunctionMatlab Spelling letter by letter codeSimplifying symbolic expression in terms of other variablesIsolating k fourier peaks
Best Answer