Commit 88a0eb85 authored by Antonio Politi's avatar Antonio Politi
Browse files

process 2 channels

parent a7addccd
......@@ -55,13 +55,26 @@ classdef dyeFcsmodel < absFcsmodel
end
function vol = computeVolume(MO, par, dyetype)
% COMPUTEVOLUME Compute focal volume return value in picoliter
% COMPUTEVOLUME Compute focal volume return value in femtoliter
% par - vector or struct of parameters
if isstruct(par)
vol = pi^(3/2).*((2*sqrt(MO.diffCoeff(dyetype)*par.tauD1)/1000).^3).*par.kappa;
vol = pi^(3/2).*MO.computeRadius(par, dyetype).^3.*par.kappa;
else
vol = pi^(3/2).*MO.computeRadius(par, dyetype).^3.*par(:,9);
end
end
function vol = computeConcentration(MO, par, dyetype)
% COMPUTECONCENTRATION Compute concentration and returns value
% in nM
% par - vector or struct of parameters
% Na = 0.6022140 (=
% 6.022140*10^23*10^-15(femtoliter)*10^-9(to get nM))
Na = 0.6022140;
if isstruct(par)
vol = par.N./MO.computeVolume(par, dyetype)/Na;
else
vol = pi^(3/2).*((2*sqrt(MO.diffCoeff(dyetype)*par(:,5))/1000).^3).*par(:,9);
vol = par(:,1)./MO.computeVolume(par, dyetype)/Na;
end
end
......@@ -110,11 +123,12 @@ classdef dyeFcsmodel < absFcsmodel
norm(1,1) = normT(pos);
end
function [thetaT, tauT] = fitThetaTtauTArray(MO, dataC, kappa)
function [thetaT, tauT] = fitThetaTtauTArray(MO, dataC, kappa, iC)
% FITTHETATTAUTARRAY find optimal thetaT and tauT for several data simultaneously with fixed kappa
% INPUT:
% dataC - a cell array containing [tau, corr] arrays
% dataC - a cell array containing [tau corrCh1 corrCh1_e corrCh2 corrCh2_e Xcorr Xcorr_e] arrays
% kappa - fixed kappa value
% iC - index of channel to be used 1 - Ch1, 2 - Ch2, 3 - XCorr
% OUTPUT:
% thetaT - mean optimal thetaT for several measurements
% tauT - mean optimal tauT for several measurements
......@@ -126,7 +140,7 @@ classdef dyeFcsmodel < absFcsmodel
outParCorr = [];
outParCorr_thetaT = [];
for idata = 1:length(dataC)
data = dataC{idata}(:,[1 2 3]);
data = dataC{idata}(:,[1 iC*2 iC*2+1]);
[thetTfit(idata,:), normCorr_thetaT(:,idata)] = MO.fitThetaTtauT(data, kappa);
end
tauT = mean(thetTfit(:,3));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment