Solving equations involving log
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi, All
How can i solve for 'x' in following equation given values of 'N' , 'U' and 'r' using Matlab.
![matlab_eqn.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/195378/matlab_eqn.png)
0 comentarios
Respuestas (3)
Rick Rosson
el 17 de Nov. de 2018
Editada: Rick Rosson
el 17 de Nov. de 2018
x = log ( 1 + U * (r^N - 1) ) / log(r);
madhan ravi
el 17 de Nov. de 2018
Editada: madhan ravi
el 17 de Nov. de 2018
syms x r N U
eqn=(r^x-1)/(r^N-1)==U;
x=solve(eqn,x);
pretty(x) %to display in a neat manner
0 comentarios
Star Strider
el 17 de Nov. de 2018
Using built-in MATLAB functions (no Toolboxes required):
U = 4.2;
N = 1.1;
r = 3.1;
fcn = @(x) ((r.^x - 1)./(r.^N -1)) - U;
x_soln = fzero(fcn, 1)
and more robustly, using the Optimization Toolbox:
x_soln = fsolve(fcn, 1)
Experiment to get the result you want.
0 comentarios
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!