Solving equations involving log

Hi, All
How can i solve for 'x' in following equation given values of 'N' , 'U' and 'r' using Matlab.
matlab_eqn.png

回答 (3 件)

Rick Rosson
Rick Rosson 2018 年 11 月 17 日
編集済み: Rick Rosson 2018 年 11 月 17 日

0 投票

x = log ( 1 + U * (r^N - 1) ) / log(r);

1 件のコメント

Masood Abbasi
Masood Abbasi 2018 年 11 月 17 日
Thanks Rick
I know that its the equation we get, but how can i formulate my equation in Matlab equation solver to get solution (x) without writing all equation myself

サインインしてコメントする。

madhan ravi
madhan ravi 2018 年 11 月 17 日
編集済み: madhan ravi 2018 年 11 月 17 日

0 投票

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
Star Strider
Star Strider 2018 年 11 月 17 日

0 投票

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.

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

質問済み:

2018 年 11 月 17 日

回答済み:

2018 年 11 月 17 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by