フィルターのクリア

saving value to .txt file with using dlmwrite

2 ビュー (過去 30 日間)
Libor Voprsalek
Libor Voprsalek 2019 年 5 月 25 日
コメント済み: dpb 2019 年 5 月 25 日
Hello, I trying to save a vector into the .txt file with using dlmwrite.
prozapis = [vysl,vysl2]
dlmwrite('dlmwrite_akc_1a2t.txt',prozapis,'delimiter','');
Here is the code I am using. Both vectors VYSL and VYSL2 contains 144 values, so vector PROZAPIS contains 288 values.
But the size of created txt file "dlmwrite_akc_1a2" is 289 byte instead of 288 and I need to reach .txt file which size is 288 byte.
Thank you for help.
  1 件のコメント
dpb
dpb 2019 年 5 月 25 日
You can't control the length of the file dlmwrite creates by default; it is a text file and the default precision is 5 digits which will be written with a '%g' format so may be either integers, floating point with decimal or exponential notation depending wholly on the magnitude of the output. Plus, there's the delimiter character which is one byte each element.
You can't output a 288-byte file containing 288 (default) double precision values, anyway; that's on possible if each is <=255 and you write a stream file with 8-bit values via fopen and fwrite
You'll have to describe far more fully what you have and what you're expecting--what you've actually written isn't possible.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by