I was wondering how to convert a file created using ascill to an integer.

1 回表示 (過去 30 日間)
Han
Han 2022 年 1 月 8 日
コメント済み: Image Analyst 2022 年 1 月 9 日
Hello. Respected seniors.
I'm not familiar with English, so I'm using a translator, so please forgive me if the sentences are weird.
I made a 127x127 matrix with the experimental data for use in other programs.
I made a command to automatically create and save the created matrix data using save( 'file name' , 'data' , '--ascii' ).
However, when I opened the created file, the data values automatically became 8 digits because of ascill.
For example, the value 187 is stored as 1.8700000+e2.
The program that uses the saved document can read it without a decimal point
However, I have no idea how to structure the code, so I need help.

採用された回答

Image Analyst
Image Analyst 2022 年 1 月 8 日
Try writematrix
writematrix(data, 'my data.txt');
  3 件のコメント
Han
Han 2022 年 1 月 9 日
Thank you!!
Thanks to you, I found dlmwrite with a related search and solved it!!
Image Analyst
Image Analyst 2022 年 1 月 9 日
You're welcome. You can also use csvwrite(), which also works in antique versions. Since I helped you find the answer, can you click the "Accept this answer"? Thanks in advance. 🙂

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by