New configurable simscape model. Add logging block
This commit is contained in:
@@ -108,6 +108,69 @@ These functions are defined below.
|
||||
save('./mat/conf_simscape.mat', 'conf_simscape');
|
||||
#+end_src
|
||||
|
||||
* Logging Configuration
|
||||
:PROPERTIES:
|
||||
:header-args:matlab+: :tangle ../src/initializeLoggingConfiguration.m
|
||||
:header-args:matlab+: :comments none :mkdirp yes :eval no
|
||||
:END:
|
||||
<<sec:initializeLoggingConfiguration>>
|
||||
|
||||
** Function description
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
function [] = initializeLoggingConfiguration(args)
|
||||
#+end_src
|
||||
|
||||
** Optional Parameters
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
arguments
|
||||
args.log char {mustBeMember(args.log,{'none', 'all'})} = 'none'
|
||||
args.Ts (1,1) double {mustBeNumeric, mustBePositive} = 1e-3
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Structure initialization
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
conf_log = struct();
|
||||
#+end_src
|
||||
|
||||
** Add Type
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
switch args.log
|
||||
case 'none'
|
||||
conf_log.type = 0;
|
||||
case 'all'
|
||||
conf_log.type = 1;
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Sampling Time
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
conf_log.Ts = args.Ts;
|
||||
#+end_src
|
||||
|
||||
** Save the Structure
|
||||
:PROPERTIES:
|
||||
:UNNUMBERED: t
|
||||
:END:
|
||||
#+begin_src matlab
|
||||
save('./mat/conf_log.mat', 'conf_log');
|
||||
#+end_src
|
||||
|
||||
* Ground
|
||||
:PROPERTIES:
|
||||
:header-args:matlab+: :tangle ../src/initializeGround.m
|
||||
|
Reference in New Issue
Block a user