フィルターのクリア

Convert whole numbers to decimals

4 ビュー (過去 30 日間)
Aurelius Hardy
Aurelius Hardy 2022 年 11 月 24 日
コメント済み: Abderrahim. B 2022 年 11 月 24 日
I have the following numbers that are being read in Matlab but they need to be converted to decimals 100th inches. 0, 90, 9, 224, 33, 0, 10, 18. With two columns These numbers are whole numbers in a txt file. First,
fid=fopen('snowfall.txt','r');
A=fscanf(fid,'%d %d %d %d %d %d %d %d',[2 8]);
How do I convert the numbers to decimals.
  1 件のコメント
Abderrahim. B
Abderrahim. B 2022 年 11 月 24 日
Hi!
Can you share a sample of your text file?
Thanks

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

回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022 年 11 月 24 日
One easy to display option after reading your data which are whole numbers is using /* operations, e.g.:
A = [0, 90, 9, 224; 33, 0, 10, 18];
A = A/100*100
A = 2×4
0 90.0000 9.0000 224.0000 33.0000 0 10.0000 18.0000

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by