Hi, I'm new in matlab. I would like to ask your help how I can solve the unknown variables 'a' and 'b' from the below equations in matlab.
.
I tried using the below method
. .
syms a b
eqn_1 = 20*log((1 + ((20/a)^(2*b)))^(1/2))== 0.316;
eqn_2 = 20*log((1 + ((150/a)^(2*b)))^(1/2))==33;
sol = solve([eqn_1,eqn_2],[a,b]);
However, I could not get a returned value. I received a = a, b = b
.
Grateful for your help, and please do let me know where my mistakes are. Thank you.

 採用された回答

madhan ravi
madhan ravi 2018 年 8 月 21 日
編集済み: madhan ravi 2018 年 8 月 21 日

0 投票

Try this:
syms a b
eqn_1 = 20*log10((1 + ((20/a).^(2*b))).^(1/2))== 0.316;
eqn_2 = 20*log10((1 + ((150/a).^(2*b))).^(1/2))==33;
[a,b] = vpasolve([eqn_1,eqn_2],[a,b])
ANSWER
a =
33.350407439877975992438632838773
b =
2.526670930138947892001693474408
YOUR MISTAKES
1) syms f n should be syms a b
2) To view solution sol.a and sol.b you would get your answer because you received them in the form of struct so. to view struct with fields you just simply add dot in between.

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2018 年 8 月 21 日

編集済み:

2018 年 8 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by