]> Creatis software - CreaPhase.git/blob - octave_packages/control-2.3.52/@lti/ctranspose.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / control-2.3.52 / @lti / ctranspose.m
1 ## Copyright (C) 2012   Lukas F. Reichlin
2 ##
3 ## This file is part of LTI Syncope.
4 ##
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.
9 ##
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.
14 ##
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/>.
17
18 ## -*- texinfo -*-
19 ## Conjugate transpose or pertransposition of LTI objects.
20 ## Used by Octave for "sys'".
21 ## For a transfer-function matrix G, G' denotes the conjugate
22 ## of G given by G.'(-s) for a continuous-time system or G.'(1/z)
23 ## for a discrete-time system.
24 ## The frequency response of the pertransposition of G is the
25 ## Hermitian (conjugate) transpose of G(jw), i.e.
26 ## freqresp (G', w) = freqresp (G, w)'.
27 ## @strong{WARNING:} Do @strong{NOT} use this for dual problems,
28 ## use the transpose "sys.'" (note the dot) instead.
29
30 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
31 ## Created: May 2012
32 ## Version: 0.1
33
34 function sys = ctranspose (sys)
35
36   if (nargin != 1)  # prevent sys = ctranspose (sys1, sys2, sys3, ...)
37     error ("lti: ctranspose: this is an unary operator");
38   endif
39
40   [p, m] = size (sys);
41   ct = isct (sys);
42
43   sys = __ctranspose__ (sys, ct);
44
45   sys.inname = repmat ({""}, p, 1);
46   sys.outname = repmat ({""}, m, 1);
47
48 endfunction