I'm also having problems with loading *.d01 files. This is the error I receive:
Code: Select all
Invalid field name:
'SR830_lock-in_Sensitivity'.
Error in setfield (line 33)
s.(deblank(strField)) = varargin{end};
Error in eprload_specman>SpecMandsc (line
130)
Error in eprload_specman (line 73)
Error in eprload (line 176)
I've included the file that is giving me this problem, albeit renamed as a *.m file. Previously in 4.5.5 I had built a *.d01 file import script that utilized the eprload function. The code is fairly simple and works for all of the *.d01 files that we've made in our lab.
Code: Select all
function [ColumnMatrix,ArrayofNames] = d01load(filename)
%Loads *.d01 files into convenient vectors
% [ColumnMatrix,ArrayOfNames]=d01load(filename)
[~,data,~]=eprload(filename);
LD=length(data);
if exist([filename(1:end-3) 'exp']);
%Import *.exp file as string to find param vals
fullstr=fileread([filename(1:end-3) 'exp']);
begpos=strfind(fullstr,'[aquisition]')+13;
endpos=strfind(fullstr,'[params]')-3;
searchstr=fullstr(begpos:endpos);
clear fullstr
%all of the stored vectors have ";a;" before their name
allfields=strfind(searchstr,';a;')+3;
LA=length(allfields);
%Matrix with columns of data, start making zeros
mat=zeros(LD/LA,LA);
%Cell Array for names
names=cell(1,LA);
for i=1:length(allfields)-1
names{1,i}=searchstr(allfields(i):allfields(i+1)-9);
end
names{1,LA}=searchstr(allfields(end):end);
%Find Field Axis & Build initial "mat" variable
FieldNum=0;
for i=1:length(names)
if strfind(names{1,i},'@FLD')~=0
FieldNum=i;
end
mat(:,i)=data((i-1)*LD/LA+1:i*LD/LA);
end
%Swap two columns if FLD axis exists
if FieldNum~=0
mat(:,[1,FieldNum])=mat(:,[FieldNum,1]);
tstr1=names{1,1}; names{1,1}=[];
tstr2=names{1,FieldNum}; names{1,FieldNum}=[];
names{1,1}=tstr2;
names{1,FieldNum}=tstr1;
% names{[1,FieldNum],1}=names{[FieldNum,1],1};
end
else
if ~mod(LD,3)
mat=zeros(LD/3,3);
mat(:,1)=data(1:LD/3);
mat(:,2)=data(LD/3+1:2*LD/3);
mat(:,3)=data(2*LD/3+1:LD);
elseif ~mod(LD,4)
mat=zeros(LD/4,4);
mat(:,1)=data(1:LD/4);
mat(:,2)=data(LD/4+1:2*LD/4);
mat(:,3)=data(2*LD/4+1:3*LD/4);
mat(:,4)=data(3*LD/4+1:LD);
elseif ~mod(LD,2)
mat=zeros(LD/2,2);
mat(:,1)=data(1:LD/2);
mat(:,2)=data(LD/2+1:LD);
else
mat=data;
end
names='No *.exp File Given';
end
ColumnMatrix=mat;
ArrayofNames=names;
end