フィルターのクリア

How can I cut some digits from a number?

2 ビュー (過去 30 日間)
sadel
sadel 2011 年 6 月 26 日
How can I cut some digits from a number like this 0.0000005566?
How can I keep only the first 4 decimal digits?
I use vpa but this return something else.
b=0.0000005566
vpa(b,4)
ans =
5.566*10^(-7)
examples:
0.0000345->0
0.001234->0.0012
12.4234234->12.4234
121313.334242->121313.3342
  1 件のコメント
James Tursa
James Tursa 2011 年 6 月 26 日
Can you give some examples of input and desired output?

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

採用された回答

Oleg Komarov
Oleg Komarov 2011 年 6 月 26 日
n = 121313.334242;
fix(n*10000)/10000
  1 件のコメント
sadel
sadel 2011 年 6 月 26 日
hahaha I was just thinking the same!!!!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by