Skip to content
Snippets Groups Projects
Commit eebd0453 authored by William Lövfors's avatar William Lövfors
Browse files

added a function that can rename profile likelihood file names to be slightly...

added a function that can rename profile likelihood file names to be slightly worse. Useful if e.g. rerunning parameters when the old best files might be infeasible. Note that the parameter values are not touched.
parent 42b58450
Branches
No related tags found
No related merge requests found
function [] = RenamePLFiles(path, offset)
if nargin<1, path='.'; end
if nargin<2, offset = 1; end
files = dir(path);
for i = 1:length(files)
[match] = regexp(files(i).name, '\[(min|max),.+\(([-0-9.]+)\)','tokens');
if ~isempty(match)
value = str2double(match{1}{2});
if strcmp(match{1}{1},'max')
newValue=value-offset;
elseif strcmp(match{1}{1},'min')
newValue=value+offset;
end
movefile([files(i).folder '/' files(i).name], strrep([files(i).folder '/' files(i).name], match{1}{2}, sprintf('%.4f',newValue)))
end
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment