Mercurial > hg > ltpda
diff m-toolbox/m/built_in_models/smodel/smodel_model_step.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/m/built_in_models/smodel/smodel_model_step.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,125 @@ +% A built-in model of class ao called step +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: A built-in model of class ao called step +% +% CALL: +% mdl = smodel(plist('built-in', 'step')); +% +% INPUTS: +% +% +% OUTPUTS: +% mdl - an object of class smodel +% +% +% INFO: +% <a href="matlab:utils.models.displayModelOverview('smodel_model_step')">Model Information</a> +% +% +% REFERENCES: +% +% +% VERSION: $Id: smodel_model_step.m,v 1.3 2011/04/29 12:25:03 luigi Exp $ +% +% HISTORY: +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% YOU SHOULD NOT NEED TO EDIT THIS MAIN FUNCTION +function varargout = smodel_model_step(varargin) + + varargout = utils.models.mainFnc(varargin(:), ... + mfilename, ... + @getModelDescription, ... + @getModelDocumentation, ... + @getVersion, ... + @versionTable); + +end + + +%-------------------------------------------------------------------------- +% AUTHORS EDIT THIS PART +%-------------------------------------------------------------------------- + +function desc = getModelDescription + desc = 'constructs a step-function of amplitude A at time toff.'; +end + +function doc = getModelDocumentation + doc = sprintf([... + ''... + ]); +end + +% default version is always the first one +function vt = versionTable() + + vt = {... + 'Version 1', @version1, ... + }; + +end + +% This version is ... +% +function varargout = version1(varargin) + + if nargin == 1 && ischar(varargin{1}) + switch varargin{1} + case 'plist' + + % The plist for this version of this model + pl = plist(); + + + + % set output + varargout{1} = pl; + + case 'description' + varargout{1} = 'This version is version 1.'; + case 'info' + % Add info calls for any other models that you use to build this + % model. For example: + % varargout{1} = [ ... + % ao_model_SubModel1('info', 'Some Version') ... + % ao_model_SubModel2('info', 'Another Version') ... + % ]; + % + varargout{1} = []; + otherwise + error('unknown inputs'); + end + return; + end + + % build model + pl = varargin{1}; + + a = smodel('A.*(t >= toff)'); + a.setXvar('t'); + a.setParams({'A','toff'}, {[],[]}); + a.setName('Step at toff'); + a.setDescription('Step function of amplitude A at time toff'); + + varargout{1} = a; + +end + + +%-------------------------------------------------------------------------- +% AUTHORS SHOULD NOT NEED TO EDIT BELOW HERE +%-------------------------------------------------------------------------- + + +%-------------------------------------------------------------------------- +% Get Version +%-------------------------------------------------------------------------- +function v = getVersion + + v = '$Id: smodel_model_step.m,v 1.3 2011/04/29 12:25:03 luigi Exp $'; + +end \ No newline at end of file