Hi Grant,
Thanks for your reply.
I have tried the data analysis offline. While saving it in .mlv it saves all the variables perfectly. I tried using csvwrite and dlmwrite as well, but they just write random number instead of the variables I specify in the syntax.
Here is the code I am using. The saving part at the bottom is what is bugging me. Everything else works fine. Please suggest another way to do this.
Thanks,
Chintan
data=-load(dataf); %load decay data
head=load(headf); %load header
laser = load(laserf);
data_length=length(data);
mode=head(1); %Single=0, Multi=1, Filter=2
tres=head(2)*10^9; %resolution in ns
switch mode
case 0
lamb_num=1;
lambdas=head(12); %lambda summary
lambda_vec=head(13+lamb_num:end); %vector with wavelengths
dec_num=head(10);
rep_num=head(11);
flag=0;
case 1
Wini=head(9); %first wavelength (nm)
Wend=head(10); %final wavelength (nm)
Wstp=head(8) ; %steps (nm)
lambdas=[Wini Wstp Wend]; %lambda summary
lambda_vec= head(14:end-1); %vector with wavelengths
lamb_num=head(11)/head(12); %number of wavelengths measured
dec_num=head(11);
Wini=head(9); %first wavelength (nm)
Wend=head(10); %final wavelength (nm)
Wstp=head(8) ; %steps (nm)
rep_num=head(12);
gain = head(7);
flag=0;
case 2
dec_num=head(9);
rep_num=head(7);
filter_wheel_pos=head(8);
center_wavelenghts=head(13:end);
flag=1;
end
lim=[30/tres 100/tres];
trspec=data(lim(1):lim(2),:); %truncate data
laser=laser(lim(1):lim(2),:);
trspec=trspec-ones(lim(2)-lim(1)+1,1)*mean(trspec(1:2/tres,:)); %detrend (substract mean of first 2 ns)
time_vec=[0:lim(2)-lim(1)]*tres;
stspec=trapz(trspec);
if flag==0
save('Processed','mode','tres','dec_num','rep_num','lambda_vec','lambdas','trspec','stspec','time_vec','gain','laser');
end
if flag == 1
save('Processed','mode','tres','dec_num','rep_num','trspec','stspec','time_vec','filter_wheel_pos','center_wavelenghts','fwhm');
end