Matlab corrupts excel file after/during read

조회 수: 5 (최근 30일)
Jeffrey Schlang
Jeffrey Schlang 2017년 5월 8일
편집: Jan 2017년 5월 8일
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

답변 (1개)

Jan
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.

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by