1 ## Copyright (C) 2010 Lukas F. Reichlin
3 ## This file is part of LTI Syncope.
5 ## LTI Syncope is free software: you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation, either version 3 of the License, or
8 ## (at your option) any later version.
10 ## LTI Syncope is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with LTI Syncope. If not, see <http://www.gnu.org/licenses/>.
19 ## Common code for adjusting SS model data.
20 ## Used by @ss/ss.m, others possibly follow.
22 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
23 ## Created: October 2010
26 function [a, b, c, d, tsam] = __adjust_ss_data__ (a, b, c, d, tsam);
28 if (isempty (a)) # static system
29 a = []; # avoid [](nx0) or [](0xn)
34 if (isempty (c)) # ss (a, b), ss (a, b, [], [], ...)
36 d = zeros (rows (a), columns (b));
37 else # ss (a, b, c), ss (a, b, c, [], ...)
38 d = zeros (rows (c), columns (b));
42 if (isempty (b) && isempty (c)) # sys = ss ([], [], [], d)
43 b = zeros (0, columns (d));
44 c = zeros (rows(d), 0);