Commit 9ac9d4cf authored by Marco Berzborn's avatar Marco Berzborn

Merge branch 'startup_fix' into 'master'

User folder startup.m

See merge request !11
parents a5156934 47055c04
8
\ No newline at end of file
9
\ No newline at end of file
......@@ -61,6 +61,28 @@ else
end
end
%% Create a custom startup file to set the correct path at startup
str_to_startup = 'addpath(pathdef())';
full_str_to_startup = strcat("disp('Loading ita_toolbox_path from local pathdef.')\n", str_to_startup);
startup_file_user = fullfile(upath, 'startup.m');
if exist(startup_file_user, 'file')
% check if a startup file exists and append userpath if necessary
str_contains = fileread(startup_file_user);
if ~contains(str_contains, str_to_startup)
fileID = fopen(startup_file_user, 'a');
fprintf(fileID, strcat('\n', full_str_to_startup));
end
else
% if startup does not exist create and add pathdef from userpath
fileID = fopen(startup_file_user, 'w');
fprintf(fileID, full_str_to_startup);
fclose(fileID);
end
%% Return path
if nargout
outpathStr = [];
prefixToolboxIdx = strfind(fullpath,prefixToolbox);
......
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