drive space exist and not able to save txt file

1 回表示 (過去 30 日間)
omnia
omnia 2024 年 4 月 25 日
コメント済み: Dyuman Joshi 2024 年 4 月 25 日
Hi all.
I am running a for loop to generate binary file and save it as .txt file to be used later (305MB each file). Suddenly, at some point in the loop the output files becomes empty with zero byte (although in matlab the data exist). I thought it was due to space on the drive and I empty around 200G from the drive. when continuing the loop, one file only is written with size of 305MB and then all zero again. At that point I am unable to save any change to my .m file too.
Any help
  1 件のコメント
Dyuman Joshi
Dyuman Joshi 2024 年 4 月 25 日
Can you share your code?

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

回答 (1 件)

Gayatri
Gayatri 2024 年 4 月 25 日
Hi Omnia,
Here are several potential causes and troubleshooting steps you can take:
  • Ensure you are correctly closing file handles after writing. MATLAB has a limit on the number of file handles that can be open at any given time. If you open a file with "fopen" and forget to close it with "fclose", you can run out of available file handles which could cause subsequent file operations to fail.
  • If you're using "fprintf" or a similar function to write text files and encounter issues, consider using MATLAB's "save" function to save variables directly in the MAT format which might be more robust and efficient for large data sets.
  • MATLAB itself might have entered an unstable state. Restarting MATLAB can resolve issues related to its internal state.
Please refer the below documentation for save function: https://www.mathworks.com/help/matlab/ref/save.html
I hope it helps!

カテゴリ

Help Center および File ExchangeLow-Level File I/O についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by