Commit 68d1c5a1 authored by Jakob Gabriel's avatar Jakob Gabriel
Browse files

misc.ss.combineInputSignals: updated example to current quantity-Syntax

parent 609df4b3
......@@ -14,13 +14,11 @@ function u = combineInputSignals(myStateSpace, t, varargin)
%
% Example:
% -------------------------------------------------------------------------
% myStateSpace = ss(-1, [1, 2], 1, [], 'InputName', {'control', 'disturbance'});
% t = linspace(0, 4, 201);
% disturbanceSignal = quantity.Symbolic(sin(sym('t')), 'grid', t, ...
% 'variable', sym('t'), 'name', 'disturbance');
% u = misc.ss.combineInputSignals(myStateSpace, t, 'disturbance', disturbanceSignal);
% y = quantity.Discrete(lsim(myStateSpace, u.on(), t), 'grid', t, ...
% 'gridName', 't', 'name', 'y');
% myStateSpace = ss(-1, [1, 2], 1, [], "InputName", {'control', 'disturbance'});
% t = quantity.Domain("t", linspace(0, 4, 201));
% disturbanceSignal = quantity.Symbolic(sin(sym("t")), t, "name", "disturbance");
% u = misc.ss.combineInputSignals(myStateSpace, t.grid, "disturbance", disturbanceSignal);
% y = quantity.Discrete(lsim(myStateSpace, u.on(), t.grid), t, "name", "y");
% plot([y; u]);
% -------------------------------------------------------------------------
......@@ -45,8 +43,8 @@ end
% replace '.' in varargin names, to obtain valid fieldnames
newVarargin = varargin;
for it = 1 : numel(newVarargin)
if ischar(newVarargin{it}) || isstring(newVarargin{it})
newVarargin{it} = strrep(newVarargin{it}, '.', 'POINT');
if isstring(newVarargin{it}) || ischar(newVarargin{it})
newVarargin{it} = strrep(newVarargin{it}, ".", "POINT");
end
end
myParser.parse(newVarargin{:});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment