Data storage in matlab.
显示 更早的评论
Hi, I have a cpp code and I'm running it in matlab using mex command. I tried storing my program output in a '.dat' file (using fprintf command), but all the data isn't get printed. Some portion of data is lost. Why is it so? The code runs well when I run it in VS and output is also ok. But Matlab is giving problem.
3 个评论
Walter Roberson
2012-7-24
Are you fclose()'ing the file after you print the data ?
Is it only the last line that is going missing? If so then you might be missing writing a final \n
Jan
2012-7-24
Please show us the corresponding code and explain how you find out, that the data are not printed.
Sean de Wolski
2012-7-25
Amit's comment from flag:
Thanks Walter. Not fclose()ing the file was the cause of problem. Thanks alot.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Compiler 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!