Matlab corrupts excel file after/during read
5 次查看(过去 30 天)
显示 更早的评论
I am using xlsread command. It seems to corrupt the file. The first pass it reads the data perfectly. Up until now I have not had this issue. When I rerun the script I get the following error. When I open the excel file it is corrupted.
File \\Shared\Users\xx\Test_Data\yyy\xxxk\Jeff_Schlang\xxxa\SNo001\Noise_Source\Noise_data_parsed.xls not in Microsoft Excel Format.
Error in Read_Noise_Src_ENR_fct_revB (line 34) [enr,label]=xlsread(filedir,i) ;
I did not write or do anything to the file? this seems to be a new problem so I restarted the computer, but that did not correct the issue. Any ideas?
I am using Matlab 2015b & Excel 2016
0 个评论
回答(1 个)
Jan
2017-5-8
编辑:Jan
2017-5-8
Try to open the file in Excel. Does this work? If not, it looks like the file is corrupted. Restore it from your backup. Create a new backup for the otehr files you process with your Matlab script. Afterwards start to examine your code: It is unlikely that Matlab xlsread damages files. On one hand it opens the file for reading only, on the other hand it has been tested and used millions of times. Perhaps the hard drive is corrupted (check this), or you have an fopen anywhere in your code. Maybe another user has written to the file, or it is a malware attack?
I did not write or do anything to the file?
Obviously you or somebody else did.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!