A = str2num(get(handles.A_par1, 'String'));
B = str2num(get(handles.A_par2, 'String'));
S = str2num(get(handles.A_par3, 'String'));
D = str2num(get(handles.D_size, 'String'));

X = [-20:0];

A_tmp = exp(X/S); A_tmp = A*A_tmp/A_tmp(end-D-1);
Apical = .8 + A_tmp; Apical((end-D):end) = B;% handles.Apical_Dist = flipud(Apical')';
%plot(handles.axes2, [X, flipud(abs(X)')'], [Apical, flipud(Apical')']);
plot(handles.axes2, handles.Apical_Dist);