function buttonloadCAA(hObject, eventdata, Empty_Button, Buttons, Footnote, AxesC, AxesA, AxesSOLC, AxesSOLA, Datainfo, Polysettings, titles, uonoff, uonoffC, regcont, regcontC, typeAFS, plotoptions)
data = get(Empty_Button,'UserData');
data.isdata = 0;

data.xlc = [];
data.ylc = [];
data.xla = [];
data.yla = [];

data.Draw = [];
data.Uraw = [];
data.Sraw = [];
data.Vraw = [];
data.maxz = 0;

data.D = [];
data.L = [];
data.R = [];
data.pointsC = [];
data.pointsA = [];
data.afsC = [];
data.afsA = [];
data.motion = 0;
data.motionC = 0;

data.isAFSC = 0;
data.isAFSA = 0;
data.AFSC = [];
data.AFSA = [];
data.istrace = 0;

data.fixA = [];
data.fixC = [];
data.choosen = zeros(3,1);
data.choosenC = zeros(3,1);

data.isnmf = 0;
data.afscomputed = [0; 0];
data.selectplot = [0; 0];

data.givenc.s = 0;
data.givenc.is = 0;
data.givenc.line = [];
data.givenc.afs = [];

data.givena.s = 0;
data.givena.is = 0;
data.givena.line = [];
data.givena.afs = [];

data.maxnoise = 2.E-1;

set(typeAFS(1), 'Value', 0);
set(typeAFS(2), 'Value', 0);
set(typeAFS(3), 'Value', 0);

set(plotoptions(1), 'Value', 0);
data.isclosure = 0;
data.isshift = get(plotoptions(2), 'Value');
data.ispeakposition = get(plotoptions(3), 'Value');
data.isxreverse= get(plotoptions(4), 'Value');

data.full.isC = 0;
data.full.isA = 0;

data.full.AFSC = [];
data.full.AFSA = [];

data.regcon = 0;
data.regconC = 0;

data.isregcon = zeros(1,3);
data.isregconC = zeros(1,3);

set(uonoff(1), 'Value', 1);
set(uonoffC(1), 'Value', 1);
set(regcont(1), 'Value', 1);
set(regcontC(1), 'Value', 1);

set(titles(5),'String','filename');

set(Datainfo(2),'String',' spectra:');
set(Datainfo(3),'String',' channels:');
set(Datainfo(5),'String',' s(1):');
set(Datainfo(6),'String',' s(2):');
set(Datainfo(7),'String',' s(3):');
set(Datainfo(8),'String',' s(4):');

set(Polysettings(1),'String',' 1.0e-12');

onoffButton(Buttons,[],2:6);

set(titles(3), 'String', 'AFS factor C');
set(titles(4), 'String', 'AFS factor S');

plot(AxesC,1,0,'w');
plot(AxesA,1,0,'w');
plot(AxesSOLC,1,0,'w');
plot(AxesSOLA,1,0,'w');

if ispc
    dlm = '\';
else
    dlm = '/';
end

if isfield(data,'PathName') == 0
    actpwd = pwd;
    if strcmp(actpwd(end-9:end), 'subfcnsCAA') == 1
        data.PathName = actpwd(1:end-10);
    else
        data.PathName = [pwd, dlm];
    end
end

actpwd = pwd;
cd(data.PathName);
[FileName,PathName,FilterIndex] = uigetfile('*.mat','Select .mat file including the data Matrix D');
cd(actpwd);

if FilterIndex == 0
    set(hObject,'UserData',data);
    set(Footnote,'String',' Warning: data-loading process canceled.','ForegroundColor','red');
    return
end
data.FileName = FileName;
data.PathName = PathName;

load([PathName FileName]);
if ~exist('D')
    set(Footnote,'String',[' Warning: no matrix D in file "',FileName,'"'],'ForegroundColor','red');
    set(Empty_Button,'UserData',data);
    return
else
    k = size(D,1);
    n = size(D,2);
    if min(k,n) < 2
        set(Footnote,'String',[' Warning: matrix D of bad dimension: ', num2str(k), ' x ', num2str(n)],'ForegroundColor','red');
        set(Empty_Button,'UserData',data);
        return
    end
    
    if (~exist('t')) && (exist('T')) && (max(size(T)) == k) && (min(size(T)) == 1)
        t = T;
    elseif (~exist('t')) || (max(size(t)) ~= k) || (min(size(t)) ~= 1)
        t = 0:k-1;
    end
    
    if (~exist('x')) && (exist('X')) && (max(size(X)) == n) && (min(size(X)) == 1)
        x = X;
    elseif (~exist('x')) || (max(size(x)) ~= n) || (min(size(x)) ~= 1)
        x = 0:n-1;
    end
    
    set(titles(5),'String',['file: ', [PathName, FileName]]);
%     set(titles(5),'String',['file: C:/', FileName]);
%     set(titles(5),'String',['file: C:/dataset.mat']);
    set(Datainfo(2),'String',[' spectra: ',num2str(size(D,1))]);
    set(Datainfo(3),'String',[' channels: ',num2str(size(D,2))]);
    
    if x(1) > x(2)
        x = x(end:-1:1);
        D = D(:,end:-1:1);
    end
    if t(1) > t(2)
        t = t(end:-1:1);
        D = D(end:-1:1,:);
    end
    
    tim = cputime;
    [U,S,V] = svds(D,5);
    tim = cputime-tim;
    
    set(Footnote,'String',['svds-computation-time:  ',num2str(tim),' s'],'ForegroundColor','black');
    
    set(Datainfo(5),'String',[' s(1): ',num2str(S(1,1),'%3.3f')]);
    set(Datainfo(6),'String',[' s(2): ',num2str(S(2,2),'%3.3f')]);
    if min(k,n) > 2
        set(Datainfo(7),'String',[' s(3): ',num2str(S(3,3),'%3.3f')]);
    else
        set(Datainfo(7),'String',[' s(3):  ---']);
    end
    if min(k,n) > 3
        set(Datainfo(8),'String',[' s(4): ',num2str(S(4,4),'%3.3f')]);
    else
        set(Datainfo(8),'String',[' s(4):  ---']);
    end
    
    for i=1:size(U,2)
        if -min(V(:,i)) > max(V(:,i))
            U(:,i) = -U(:,i);
            V(:,i) = -V(:,i);
        end
    end
    data.U = U(:,1:3);
    data.S = S(1:3,1:3);
    data.V = V(:,1:3);
    
    if size(t,2) > size(t,1) t = t';end
    if size(x,2) > size(x,1) x = x';end
    
    data.isdata = 1;
    data.D = D;
    data.t = t;
    data.x = x;
    
    data.Draw = D;
    data.Uraw = U;
    data.Sraw = S;
    data.Vraw = V;
    data.maxz = size(U,2);
    
end

set(Empty_Button,'UserData',data);
