フィルターのクリア

how to display answer in a particular format

1 回表示 (過去 30 日間)
Elysi Cochin
Elysi Cochin 2013 年 3 月 22 日
i got an answer as
-7.28135827387422e-05
1.87033878860991e-35
3.860575156847749e+003
i wanted to get the answers as
72.813
18.703
38.605
i want only this format and the value should be positive
how to do the conversion after getting the value..... please do reply...

採用された回答

Image Analyst
Image Analyst 2013 年 3 月 22 日
Try this:
a = -7.28135827387422e-05
aString = num2str(a)
decimalLocation = strfind(aString, '.')
aString = [aString(1:decimalLocation-1), aString(decimalLocation+1), '.', aString(decimalLocation+1:decimalLocation+3)]
aNumber = str2double(aString)
b = 1.87033878860991e-35
bString = num2str(b)
decimalLocation = strfind(bString, '.')
bString = [bString(1:decimalLocation-1), bString(decimalLocation+1), '.', bString(decimalLocation+1:decimalLocation+3)]
bNumber = str2double(bString)
  1 件のコメント
Elysi Cochin
Elysi Cochin 2013 年 3 月 22 日
thank u sir...

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by