Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
matlab_general
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
William Lövfors
matlab_general
Commits
f6b1da4b
Commit
f6b1da4b
authored
5 years ago
by
William Lövfors
Browse files
Options
Downloads
Patches
Plain Diff
small updates
parent
9356a89b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
FindBestParametersFile.m
+10
-1
10 additions, 1 deletion
FindBestParametersFile.m
SBPOP PACKAGE/SBPD/tools/mexmodelhandling/auxiliary/CVODEMEX/lib/CVODEmex25.lib
+0
-0
0 additions, 0 deletions
...ls/mexmodelhandling/auxiliary/CVODEMEX/lib/CVODEmex25.lib
SaveFile.m
+3
-1
3 additions, 1 deletion
SaveFile.m
with
13 additions
and
2 deletions
FindBestParametersFile.m
+
10
−
1
View file @
f6b1da4b
function
[
path
,
dirStruct
]
=
FindBestParametersFile
(
pathToSearch
)
function
[
path
,
dirStruct
]
=
FindBestParametersFile
(
pathToSearch
,
useSub
,
key
)
%FINDBESTPARAMETERSFILE finds the file containing the best parameter set
%FINDBESTPARAMETERSFILE finds the file containing the best parameter set
%based on the name. Assumes that the cost is given in parenthesis.
%based on the name. Assumes that the cost is given in parenthesis.
% [path,name] = FindBestParametersFile(path)
% [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?'
);
assert
(
exist
(
pathToSearch
,
'dir'
)
>
0
,
'Path does not exist. Are you in the right directory?'
);
if
useSub
pathToSearch
=
[
pathToSearch
'/**/*.mat'
];
end
files
=
dir
(
pathToSearch
);
files
=
dir
(
pathToSearch
);
assert
(
length
(
files
)
>
2
,
'No files to search in the provided path'
)
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
});
names
=
string
({
files
.
name
});
values
=
double
(
regexprep
(
names
,{
'.*\('
,
'\).*'
},{
''
,
''
}));
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)'
);
assert
(
any
(
~
isnan
(
values
)),
'No files contains valid names. Make sure the files has the cost in parenthesis, e.g opt(12.34)'
);
...
...
This diff is collapsed.
Click to expand it.
SBPOP PACKAGE/SBPD/tools/mexmodelhandling/auxiliary/CVODEMEX/lib/CVODEmex25.lib
+
0
−
0
View file @
f6b1da4b
No preview for this file type
This diff is collapsed.
Click to expand it.
SaveFile.m
+
3
−
1
View file @
f6b1da4b
function
[]
=
SaveFile
(
fileName
,
variable
,
variableName
)
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"
%name "variableName"
S
.
(
variableName
)
=
variable
;
S
.
(
variableName
)
=
variable
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment