Textscan question
5 ビュー (過去 30 日間)
古いコメントを表示
Hi
I'm using textscan to read text from instrument. text file looks like this :
-000.26
0000.00
-001.26
0000.00
-011.26
0000.00
-222.26
0000.00...etc.
The output of the device is in kg(kilograms). I want to read data as g(grams) without the minus and every other line(skip lines with zeroes).
Example :
-000.26 = 260
-001.26 = 1260
-011.26 = 11260
-111.26 = 111260
I used '%f32', but it reads as 0.2600(still in kg).
Thanks!
0 件のコメント
採用された回答
Walter Roberson
2011 年 12 月 8 日
Use a %f format, take the absolute value, multiply by 1000, and round().
0 件のコメント
その他の回答 (2 件)
参考
カテゴリ
Help Center および File Exchange で Labels and Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!