-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_demo.m
38 lines (29 loc) · 1.15 KB
/
run_demo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function run_demo()
% run the demo script from the WarningsNG Exporter toolbox installation directory
issue_class_file = fileparts(which('WarningsNG.Issue')); % get installation directory of Issue class file
% construct the relative path to the demos script. Is there a more elegant way to determine the base installation
% directory of a toolbox?
demo_src_dir = fullfile(issue_class_file, "..", "..", "doc", "demo");
demo_tar_dir = tempname(".");
% copy demo to local directory to prevent running in the original installation directory
disp("Populating new demo directory copy");
copyfile(demo_src_dir, demo_tar_dir);
disp("... done");
disp("Changing into new demo directory copy");
old_dir = cd(demo_tar_dir);
disp("... done: " + demo_tar_dir);
disp("Running demo live script");
WarningsNG_demo
disp("... done");
disp("Output files:");
dir("*.xml");
disp("Changing into new demo/m directory copy");
cd("m");
disp("... done");
disp("Running demo m script");
WarningsNG_demo
disp("... done");
disp("Changing to old directory");
cd(old_dir);
disp("... done");
end