From f6b1da4b05aff4ffccbc6e357da1725db47a3c67 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?William=20L=C3=B6vfors?= <william.lovfors@gmail.com>
Date: Fri, 26 Jun 2020 08:56:55 +0200
Subject: [PATCH] small updates

---
 FindBestParametersFile.m                      |  11 ++++++++++-
 .../auxiliary/CVODEMEX/lib/CVODEmex25.lib     | Bin 264366 -> 264366 bytes
 SaveFile.m                                    |   4 +++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/FindBestParametersFile.m b/FindBestParametersFile.m
index 6be5e8a..d08ec6a 100644
--- a/FindBestParametersFile.m
+++ b/FindBestParametersFile.m
@@ -1,11 +1,20 @@
-function [path,dirStruct] = FindBestParametersFile(pathToSearch)
+function [path,dirStruct] = FindBestParametersFile(pathToSearch, useSub, key)
 %FINDBESTPARAMETERSFILE finds the file containing the best parameter set
 %based on the name. Assumes that the cost is given in parenthesis. 
 %   [path,name] = FindBestParametersFile(path)
+if nargin<3, key='.'; end
+if nargin<2, useSub=0; end
+
 %%
 assert(exist(pathToSearch,'dir')>0,'Path does not exist. Are you in the right directory?');
+if useSub
+    pathToSearch=[pathToSearch '/**/*.mat'];
+end
 files=dir(pathToSearch);
 assert(length(files)>2,'No files to search in the provided path')
+names=string({files.name});
+files(cellfun(@isempty,regexp(names, key)))=[]; %removes all files not containing "key"
+
 names=string({files.name});
 values=double(regexprep(names,{'.*\(','\).*'},{'',''}));
 assert(any(~isnan(values)),'No files contains valid names. Make sure the files has the cost in parenthesis, e.g opt(12.34)');
diff --git a/SBPOP PACKAGE/SBPD/tools/mexmodelhandling/auxiliary/CVODEMEX/lib/CVODEmex25.lib b/SBPOP PACKAGE/SBPD/tools/mexmodelhandling/auxiliary/CVODEMEX/lib/CVODEmex25.lib
index f5bff8e0b7b0d1f2cc8e54ae072755ee72f612b9..ac9503f17d60e04c4756518082a737a669e223d7 100644
GIT binary patch
delta 470
zcmZ2CQDEIffeBI^7M7Og1}3KF8<kEdu|ql259Tq6Z{|?WNQH|q)-j21?(5J{MisfT
zx=jpbgz5AEMkevim4_-NU_xdfA+gN@x1R~Zgv=pAB5$>X;YNY1+Zw}|<_H&ItYebc
z{?L(eqclt(*mSY&8)6w%Qea{b<F|i0$mpYtCKmIQv5FNY2C;MdmsgA-VsI-!mTpgD
zWa5#63xPbjeS$R8Gq`DBTgA6ewP$ig^VIeq;Y^3%euui`Mjn$AKbox)bxcw+Ffn70
z@5S2#XEALLoW<<RgKG7jWz6psU`oMOi)}w~oLNf?CI+=e;1ja~Crk|LIlte`3A_N&
CZGC6}

delta 467
zcmZ2CQDEIffeBI^<_4xFM#h##8<kEdK{@6Y(*qcp#5Qv%XQV=fETBSt9U96|Axi^@
zsw=D8#GpbJU?K6%m4_-N*dYd6O#Y}OzFFY*GeMXdV~949w_3tbA#+Qx(AF5nG)JhA
z1w?5314qV9(omx;Cx29u+`cK6Q7Hwc$`Gt^`=^79KFUy4U<<d$JY}q6g{d-usQU7X
zF+>bSRT?7`4=e;=HcpUcdIs|%#9`vwr`j{QO2ABm+W8}#=@6=EH}aU2_+hG`c1qMS
zNy)(MoX%LsB;Fn{i)nknEM`9*s8VP+Zr`(v`JDn(3=)uH+fN*4*3yEBK`j>e#H_#x
O6N3cicE8`u3A_M&6@1eG

diff --git a/SaveFile.m b/SaveFile.m
index 1035f56..1534536 100644
--- a/SaveFile.m
+++ b/SaveFile.m
@@ -1,5 +1,7 @@
 function [] = SaveFile(fileName,variable, variableName)
-%SAVEFILE Saves a file with "fileName" with the content of a "variable" with
+%SaveFile, used to save file (works with parfor)
+%SaveFile(fileName,variable, variableName) 
+%Saves a file with "fileName" with the content of a "variable" with
 %name "variableName"
 
 S.(variableName)=variable;
-- 
GitLab