Solve function:Error using sym/solve>getEqns

I am having a trouble using the solve function to solve for B
syms B
M= 1024;
solve('1e-6 = (4/log2(M))*qfunc(sqrt(3*B*log2(M)/(M-1)))',B)
I am getting these now
Error using sym/solve>getEqns
List of equations must not be empty.
Error in sym/solve (line 226)
[eqns,vars,options] = getEqns(varargin{:});
Error in untitled (line 65)
solve('1e-6 = (4/log2(M))*qfunc(sqrt(3*B*log2(M)/(M-1)))',B)

回答 (2 件)

Torsten
Torsten 2022 年 4 月 1 日

1 投票

"qfunc" does not accept symbolic input, and your B is symbolic.
Star Strider
Star Strider 2022 年 4 月 1 日

1 投票

Looking at the documentation for qfunc it is straightforward to create a symbolic version —
syms B symqfunc(x)
M= 1024;
symqfunc(x) = erfc(x/sqrt(2)) / 2;
Eqn = 1e-6 == (4/log2(M))*symqfunc(sqrt(3*B*log2(M)/(M-1)));
solve(Eqn,B)
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
ans = 
710.5514874680311536574153363861
.

5 件のコメント

Abdelaziz Gohar
Abdelaziz Gohar 2022 年 4 月 4 日
Thank you!
Star Strider
Star Strider 2022 年 4 月 4 日
My pleasure!
Esteban Patricio Tipan Mantilla
Esteban Patricio Tipan Mantilla 2024 年 1 月 12 日
could you explain this line pls
symqfunc(x) = erfc(x/sqrt(2)) / 2;
Star Strider
Star Strider 2024 年 1 月 12 日
Quoting Torsten’s comment:
"qfunc" does not accept symbolic input, and your B is symbolic.
It creates a symbolic version of qfunc.
Esteban Patricio Tipan Mantilla
Esteban Patricio Tipan Mantilla 2024 年 1 月 12 日
Thank you!

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by