Problem with displaying numbers

1 回表示 (過去 30 日間)
fatemeh p
fatemeh p 2020 年 10 月 7 日
コメント済み: fatemeh p 2020 年 10 月 7 日
Hi
I wrote a code which uses "solve" function to give the answers but i have a problem with final numbers
Here is a piece of my code
clc
syms S1 S2
Range= input('Enter the Range number= ');
Pax= input ('Enter Pax number= ');
S=solve(Pax_A+x_P1*S1+x_P2*S2==log2(Pax),Range_A+x_R1*S1+x_R2*S2==log2(Range),S1,S2)
x_EW1=K(3,1);
x_EW2=K(3,2);
EmptyW=2^(Empty_A+x_EW1*S.S1+x_EW2*S.S2)
The answer it gives me is this:
2^(39769394633364550458410797485749930922818400781/2932418391465611926965763931138232972187009024)
while i want it to do the math and give me this:
12094
How can i make it possible?
  1 件のコメント
madhan ravi
madhan ravi 2020 年 10 月 7 日
STOP asking the same question MULTIPLE times!

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

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 10 月 7 日
Use double() to do the conversion
EmptyW = double(2^(Empty_A+x_EW1*S.S1+x_EW2*S.S2))
  1 件のコメント
fatemeh p
fatemeh p 2020 年 10 月 7 日
thank you

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

その他の回答 (1 件)

madhan ravi
madhan ravi 2020 年 10 月 7 日
double(EmptyW)
%or
vpa(EmptyW)
  1 件のコメント
fatemeh p
fatemeh p 2020 年 10 月 7 日
thanks

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

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by