%% cdAmPdata
% cd to the AmPdata directory

function WD = cdAmPdata
% created 2020/01/12 by Bas Kooijman, modified 2025/05/29 Nina Marn (isunix added in line 21)

%% Syntax
% WD = <../cdAmPdata.m *cdData*>

%% Description
% cd to the AmPdata directory
%
% Output
%
% * WD: current path 

%% Remarks
% Intended use: WD = cdAmPdata; ..code.. cd(WD)

WD = pwd; path = which('cdAmPdata'); 
if ismac || isunix
 ind = strfind(path,'/'); 
else
 ind = strfind(path,'\');
end
cd(path(1:ind(end)));
