Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Virtual Sensing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPAH
IN-NOVA
Virtual Sensing
Commits
ac8d8ad8
Commit
ac8d8ad8
authored
1 year ago
by
Achilles Kappis
Browse files
Options
Downloads
Patches
Plain Diff
Add Templates folder
parent
55db0fed
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Templates/.gitkeep
+0
-0
0 additions, 0 deletions
Templates/.gitkeep
Templates/MATLAB/funcTemp.m
+132
-0
132 additions, 0 deletions
Templates/MATLAB/funcTemp.m
with
132 additions
and
0 deletions
Templates/.gitkeep
0 → 100644
+
0
−
0
View file @
ac8d8ad8
This diff is collapsed.
Click to expand it.
Templates/MATLAB/funcTemp.m
0 → 100644
+
132
−
0
View file @
ac8d8ad8
%% Descriptive title of the function
% --------------------------------------------------
% Author:
% e-mail:
%
% Date: --/--/---- (DD/MM/YYYY)
%
% Copyright: MIT
% --------------------------------------------------
% Functionality: Briefly describe the functionality
% of the function here.
% --------------------------------------------------
% Input
%
% inParam_1_Name [paramType]: Parameter description goes here. Don't
%. be afraid to put as much information is
% needed to make sure the user can use the
% function properly.
%
% inParam_2_Name [paramType]: The same goes here too. Provide enough
% information to the used and make reference
% to other input or output arguments. Usually
% they are placed in quotes like: This
% parameter must have the same number of rows
% as "inputParam_1_Name".
%
%
% inParam_3_Name [paramType] (Optional): This is an optional parameter. You
% have to explicitly declare it here
% so that users know they can omit it.
% Furthermore, it's good practice to
% put optional parameters after the
% mandatory ones, although this is not
% a necessity.
%
% --------------------------------------------------
% Output
%
% outParam_1_Name [paramType]: The same "rules" apply to the output variables.
% Again, don't be "afraid" to provide as much
% information is needed for the user to be able to
% use correctly the returned values.
%
% outParam_2_Name [paramType]: Here I provide information on the way data are
% structured in this returned array. This parameter
% has dimensions N*KxM where the N corresponds to
% number of offsprings, K is the number of parents
% of each offspring and M the number of variables
% for each individual. The data are arranged as:
% [Par_1_Off_1_Var_1, Par_1_Off_1_Var_2, ...;
% Par_2_Off_1_Var_1, Par_2_Off_1_Var_2, ...;
% . , . , ...;
% . , . , ...;
% . , . , ...;
% Par_K_Off_1_Var_1, Par_2_Off_1_Var_2, ...;
% Par_1_Off_2_Var_1, Par_2_Off_1_Var_2, ...;
% Par_2_Off_2_Var_1, Par_2_Off_1_Var_2, ...;
% . , . , ...;
% . , . , ...;
% . , . , ...;
% Par_K_Off_N_Var_1, Par_2_Off_1_Var_2, ...]
%
% --------------------------------------------------
% Notes
%
% Dependencies: - State the dependencies here so that the user can get them
% and use the function. In this example the function requires
% the "pickValProb" function from the MATLAB Utilities project.
%
% - If "inParam_3_Name" is used, the values of "inParam_2_Name" will be normalised
% to sum up to unity (this is a note example).
% --------------------------------------------------
function
[
outParam_1_Name
,
outParam_2_Name
]
=
funcName
(
inParam_1_Name
,
inParam_2_Name
,
inParam_3_Name
)
% ====================================================
% Check for number of arguments
% ====================================================
narginchk
(
2
,
3
);
nargoutchk
(
1
,
2
);
% ====================================================
% Validate input arguments
% ====================================================
% Validate mandatory arguments
validateattributes
(
inParam_1_Name
,
{
'char'
,
'string'
},
{
'scalartext'
,
'nonempty'
},
mfilename
,
"Sting variable example"
,
1
);
validatestring
(
inParam_1_Name
,
[
"IN"
,
"NOVA"
,
"Project"
,
"Rulez"
],
mfilename
,
"String variable example"
,
1
);
if
strcmpi
(
selTypeinParam_1_Name
,
"Rulez"
)
if
~
isnumeric
(
inParam_2_Name
)
error
(
"funcName(): inParam_2_Name must be a positive value corresponding the awesomeness of the IN-NOVA project when inParam_1_Name is Rulez."
);
else
if
inParam_2_Name
<=
0
error
(
"funcName(): You must be mistaken somehow... IN-NOVA is more than 0 awesome. Please reconsider and call the function again!"
);
end
end
elseif
strcmpi
(
inParam_1_Name
,
"Project"
)
&&
~
isnumeric
(
inParam_2_Name
)
error
(
"funcName(): When you say Project you must also provide the project's ID."
);
end
validateattributes
(
inParam_2_Name
,
"numeric"
,
{
'nonempty'
,
'finite'
,
'nonnan'
,
'positive'
,
'real'
,
'integer'
},
mfilename
,
"inParam_2_Name"
,
2
);
% Validate and initialise optional parameters
if
nargin
>
2
validateattributes
(
inParam_3_Name
,
"numeric"
,
{
'nonnan'
,
'>='
,
2
,
'finite'
,
'real'
,
'integer'
},
mfilename
,
"inParam_3_Name"
,
3
);
else
inParam_3_Name
=
1.25e2
;
end
% ====================================================
% Calculate needed variables - Pre-processing
% ====================================================
% ====================================================
% Do your work
% ====================================================
% ====================================================
% Post-processing
% ====================================================
% ====================================================
% Return values
% ====================================================
outParam_1_Name
=
"The best output value EVER...!!!"
;
if
nargout
>
1
outParam_2_Name
=
inParam_3_Name
-
13
;
else
outParam_2_Name
=
[];
end
end
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