From fc811bdf5993bcc139e85332fb9f47ae6db41679 Mon Sep 17 00:00:00 2001
From: Jan Lemmer <jan.lemmer@fst.tu-darmstadt.de>
Date: Tue, 23 Nov 2021 08:32:11 +0100
Subject: [PATCH] Changed Initialisation to addpath in strup.m as suggested by
 JS

---
 Initialisation.m | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Initialisation.m b/Initialisation.m
index 97835f3..58c1ffe 100644
--- a/Initialisation.m
+++ b/Initialisation.m
@@ -1,10 +1,15 @@
 %% This is the PlotID Initialisation file
 % Please run this script before using PlotID
 
-%% Step 1: Add plotID location to you MATLAB path
-% This is necessary to use PlotID in your personal MATLAB Scripts
-addpath(pwd);
-savepath;
+%% Step 1: Add plotID location to you MATLAB path via startup.m
+% Change the current folder to the folder of this m-file.
+cd(fileparts(which(mfilename)));
+plotIDpath = pwd ;
+% Add PlotID path to your startup.m file
+fid = fopen(fullfile(userpath,'startup.m'),'a');
+cmdStr = ['addpath(''', plotIDpath,''');'];
+fprintf(fid,'%s\n', cmdStr);
+fclose(fid);
 
 %% Section 2 Config File
 % To make things easy, you should use the config file. The following wizard
@@ -26,4 +31,5 @@ if writeConfig
 end
 
 %%
+clc
 disp('Initialisition done.')
-- 
GitLab