Matlab corrupts excel file after/during read

5 Ansichten (letzte 30 Tage)
Jeffrey Schlang
Jeffrey Schlang am 8 Mai 2017
Bearbeitet: Jan am 8 Mai 2017
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

Antworten (1)

Jan
Jan am 8 Mai 2017
Bearbeitet: Jan am 8 Mai 2017
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.

Kategorien

Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by