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