function buttonloadconcentrationsCAA(hObject, eventdata, Empty_Button, Buttons, Footnote, AxesC, AxesA, AxesSOLC, AxesSOLA, Polysettings, uonoff, uonoffC, regcont, regcontC, type, lcs)

data = get(Empty_Button,'UserData');

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

actpwd = pwd;
cd(data.PathName);
[FileName,PathName,FilterIndex] = uigetfile('*.mat','Select .mat file including concentration matrix C');
cd(actpwd);

if FilterIndex == 0
    set(hObject,'UserData',data);
    set(Footnote,'String',' Warning: concentration-loading process canceled.','ForegroundColor','red');
    fprintf('Warning: concentration-loading process canceled.\n');
    return
else
    load([PathName FileName]);
    if ~exist('c')
        if exist('C')
            c = C;
        end
    end
    
    if exist('c')
        if size(c,1) ~= size(data.D,1)
            if size(c,2) ~= size(data.D,1)
                c = c';
            end
        end
    else
        set(Footnote,'String',[' Warning: no matrix c in file "',FileName,'"'],'ForegroundColor','red');
        fprintf('Warning: no matrix c in file "%s".\n',FileName);
        return
    end
    if size(c,1) ~= size(data.D,1)
        set(Footnote,'String',[' Warning: matrix "c" of bad dimension: ', num2str(size(c,1)), ' x ', num2str(size(c,2))],'ForegroundColor','red');
        fprintf('Warning: matrix "c" of bad dimension: %d x %d.\n',size(c,1),size(c,2));
        return
    else
        data.givenc.s = size(c,2);
        data.givenc.line = (c*diag(1./max(c)))';
        data.givenc.afs = (pinv(data.U*data.S(:,1:data.s))*c)';
        for i=1:data.givenc.s
            AFS(i,:) = data.givenc.afs(i,2:3)/data.givenc.afs(i,1);
        end
        data.givenc.afs = AFS;
        data.givenc.is = 1;
        if size(c,2) == 1
            set(Footnote,'String',[' Concentration import: ', num2str(size(c,2)), ' profile loaded. '],'ForegroundColor','k');
        else
            set(Footnote,'String',[' Concentration import: ', num2str(size(c,2)), ' profiles loaded. '],'ForegroundColor','k');
        end
    end
end

set(Empty_Button,'UserData',data);

isregcon = [0 0];   REGCON = [];
if (data.regcon > 0) && (data.isregcon(data.regcon) == 1)
    isregcon(1) = data.regcon;
    REGCON{1} = data.REGCON{isregcon(1)};
end
if (data.regconC > 0) && (data.isregconC(data.regconC) == 1)
    isregcon(2) = data.regconC;
    REGCON{2} = data.REGCONC{isregcon(2)};
end

if ~isempty(data.xla)
    plotafsCAA(AxesA, AxesC, AxesSOLA, AxesSOLC, data.xla, data.xlc, data.yla, data.ylc, data.x, data.t, data.AFSA, data.AFSC,...
               data.U*data.S, data.V', data.fixA, data.fixC, data.choosen, data.choosenC, isregcon, REGCON, data.full, ...
               data.selectplot, data.givena, data.givenc, data.tall, data.tcll, data.istrace, ...
               lcs, [data.isclosure data.isshift data.ispeakposition data.isxreverse]);
else
    plot(AxesC,1,0,'w');
    plot(AxesA,1,0,'w');
    plot(AxesSOLC,1,0,'w');
    plot(AxesSOLA,1,0,'w');
end
