Data not being written in file

I wrote code to generate a file. Code ran successfully, output window shows data being written to file. But when i open file in MATLAB drive then file size shows 0KB and when i preview the file it doesn't reflect.
Is it a general observtaion that MATLAB online takes time to reflect changes to file created ?

 Accepted Answer

Walter Roberson
Walter Roberson on 28 Dec 2024
Moved: Cris LaPierre on 28 Dec 2024

Did you remember to fclose() the file?

2 Comments

Smile Guleria
Smile Guleria on 28 Dec 2024
Moved: Cris LaPierre on 28 Dec 2024
Hey walter
your comment was life saviour. Thanks a lot man !
If this Answer solves your original question, then could you please click the "Accept this answer" link to award the answerer with "reputation points" for their efforts in helping you? They'd appreciate it. Thanks in advance. 🙂 Note: you can only accept one answer (so pick the best one) but you can click the "Vote" icon for as many Answers as you want. Voting for an answer will also award reputation points.
For full details on how to earn reputation points see: https://www.mathworks.com/matlabcentral/answers/help?s_tid=al_priv#reputation

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!