phd-simscape-micro-station/matlab/src/initializeLoggingConfiguration.m

34 lines
895 B
Mathematica
Raw Normal View History

2024-10-30 14:29:52 +01:00
function [] = initializeLoggingConfiguration(args)
arguments
args.log char {mustBeMember(args.log,{'none', 'all', 'forces'})} = 'none'
args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-3
end
conf_log = struct();
switch args.log
case 'none'
conf_log.type = 0;
case 'all'
conf_log.type = 1;
case 'forces'
conf_log.type = 2;
end
conf_log.Ts = args.Ts;
if exist('./mat', 'dir')
2024-11-06 15:16:41 +01:00
if exist('./mat/nass_model_conf_log.mat', 'file')
save('mat/nass_model_conf_log.mat', 'conf_log', '-append');
2024-10-30 14:29:52 +01:00
else
2024-11-06 15:16:41 +01:00
save('mat/nass_model_conf_log.mat', 'conf_log');
2024-10-30 14:29:52 +01:00
end
elseif exist('./matlab', 'dir')
2024-11-06 15:16:41 +01:00
if exist('./matlab/mat/nass_model_conf_log.mat', 'file')
save('matlab/mat/nass_model_conf_log.mat', 'conf_log', '-append');
2024-10-30 14:29:52 +01:00
else
2024-11-06 15:16:41 +01:00
save('matlab/mat/nass_model_conf_log.mat', 'conf_log');
2024-10-30 14:29:52 +01:00
end
end