Writing binary array to TEXT file

I have an array of dimensions 1631816 x 1. I want to write this array as a text file. I tried below-mentioned code for the same.
dlmwrite('myFile.txt', bit1)
However, it is not writing the data to a text file. For smaller matrix dimensions (10x1 or so), the same line of code is working just fine. But for my file, it is giving me output something as shown in the image below:
matlab.PNG

3 件のコメント

Rik
Rik 2019 年 9 月 30 日
Can you give an example of what exact code produces this? What is the data type of your input? What approximate size is needed to produce this issue?
Trivedi
Trivedi 2019 年 10 月 1 日
Can you give an example of what exact code produces this? What is the data type of your input?
I had an audio file which I got converted into binary bit stream. Which resuleted in an arrary of size 1631816 x 1. I want to export this array as a TEXT file. For which I used:
dlmwrite('myFile.txt', bit1)
And this resulted into a text file as mentioned in the image above.
Data type of the input was uint8.
What approximate size is needed to produce this issue?
I tried for 100x1 array whic produced similar erroneous results. For 10x1, it worked just fine.
Rik
Rik 2019 年 10 月 1 日
I can't reproduce your issue on R2019a with the code below.
bit1=uint8(randi(255,10000,1));
dlmwrite('myFile.txt', bit1)
Even with an array of the size you describe I can't reproduce this.
What release are you using? Also, it might be relevant to know what your exact OS is, and maybe even the amount of RAM you have available.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Import and Export についてさらに検索

タグ

質問済み:

2019 年 9 月 30 日

コメント済み:

Rik
2019 年 10 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by