我有一个“ .mat”文件,据说其中包含[30720000x4 double]矩阵(加速度计中的值)。当我尝试在Matlab中使用“导入数据”打开此文件时,出现以下错误:
Error using load
Can't read file F:\vibration_exp_2\GR_UB50n\bearing1\GR_UB50n_1_2.mat.
Error using load
Unknown text on line number 1 of ASCII file
F:\vibration_exp_2\GR_UB50n\bearing1\GR_UB50n_1_2.mat
"MATLAB".
Error in uiimport/runImportdata (line 456)
datastruct = load('-ascii', fileAbsolutePath);
Error in uiimport/gatherFilePreviewData (line 424)
[datastruct, textDelimiter, headerLines]= runImportdata(fileAbsolutePath,
type);
Error in uiimport (line 240)
[ctorPreviewText, ctorHeaderLines, ctorDelim] = ...
Run Code Online (Sandbox Code Playgroud)
文件大小为921MB,与我打开的其他文件相同。我也尝试使用python打开文件,但没有成功。有什么建议么?我使用MATLAB R2013b。
更多信息:
文件的创建方式:
%% acquisition of vibration data
% input:
% sample rate in Hz (max. 51200 Hz, should be used as bearing
% faults are high-frequent)
% time in seconds, stating the duration of the measurement
% (e.g. 600 seconds = 10 minutes)
% filename for the file to be saved
%
% examples:
% data = DAQ(51200, 600, 'NF1_1.mat');
% data = DAQ(51200, 600, 'NF1_2.mat');
function data = DAQ(samplerate,time,filename)
s = daq.createSession('ni'); % Creates the DAQ session
%%% Add the channels as accelerometer channels (meaning IEPE is turned on)
s.addAnalogInputChannel('cDAQ1Mod1','ai0','Accelerometer');
s.addAnalogInputChannel('cDAQ1Mod1','ai1','Accelerometer');
s.addAnalogInputChannel('cDAQ1Mod1','ai2','Accelerometer');
s.addAnalogInputChannel('cDAQ1Mod1','ai3','Accelerometer');
%s.addAnalogInputChannel('cDAQ1Mod2','ai0','Accelerometer');
s.Rate = samplerate;
s.NumberOfScans = samplerate*time;
%%% Defining the Sensitivities in V/g
s.Channels(1).Sensitivity = 0.09478; %31965, top outer
s.Channels(2).Sensitivity = 0.09531; %31966, back outer
s.Channels(3).Sensitivity = 0.09275; %31964, top inner
s.Channels(4).Sensitivity = 0.09363; %31963, back inner
data = s.startForeground(); %Acquiring the data
save(filename, 'data');
Run Code Online (Sandbox Code Playgroud)
更多信息:
当我使用简单的文本编辑器打开文件时,可以看到很多没有意义的字符?还有第一行:
MATLAB 5.0 MAT-FILE,平台:PCWIN64,创建于:2015年4月30日星期四16:29:07
更多信息: 文件本身:https ://www.dropbox.com/s/r7mavil79j47xa2/GR_UB50n_1_2.mat?dl =0这是921MB。
编辑:
如何恢复我的数据?
小智 1
要从字面上回答这个问题,我的建议是首先确保该文件没问题。文件交换上的这个工具显然知道如何诊断从版本 V5 (R8) 开始的损坏的 .MAT 文件:
http://www.mathworks.com/matlabcentral/fileexchange/6893-matcat-mat-file-corruption-analysis-tool