Format a large number into small decimal number

2 ビュー (過去 30 日間)
Soumili Sen
Soumili Sen 2020 年 10 月 21 日
コメント済み: Soumili Sen 2020 年 10 月 23 日
Hello,
I have code on function like:
hr = sqrt ( .1/ 2 ) .* (h_i+j*h_q);
hr1 = sqrt (.3/ 2 ) .* (h_i+j*h_q);
x=x = constellation(randi([1 4],50));
syms cr;
r=(hr*x+hr1*cr);
and I am getting the answer like cr*(2031273339923201/4503599627370496 - 7019058886806809i/36028797018963968) - 42472189963858493/288230376151711744)
How I will format this large number into small decimal number?

採用された回答

Spectro
Spectro 2020 年 10 月 21 日
Lookup matlab built-in functions like simplify() or vpa().
This should do the work:
vpa(r, 4)
  1 件のコメント
Soumili Sen
Soumili Sen 2020 年 10 月 23 日
yahh it is working.. Thanks

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by