Solving equations involving log
2 次查看(过去 30 天)
显示 更早的评论
Hi, All
How can i solve for 'x' in following equation given values of 'N' , 'U' and 'r' using Matlab.
0 个评论
回答(3 个)
madhan ravi
2018-11-17
编辑:madhan ravi
2018-11-17
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 个评论
Star Strider
2018-11-17
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!