1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
function Ustar = ppp_ustar (A_u,n_u,tau,order,packed)
## usage: Us = ppp_ustar(A_u,n_u,tau,order,packed)
##
## Computes the U* matrix at time tau in terms of A_u
## n_u : Number of system inputs
## If tau is a vector, computes U* at each tau and puts into a row vector:
## If packed==1
## Ustar = [Ustar(tau_1) Ustar(tau_2) ...]
## else Ustar = [Ustar(tau_1); Ustar(tau_2) ...]
## Copyright (C) 1999 by Peter J. Gawthrop
## $Id$
if nargin<2
n_u = 1;
endif
if nargin<3
tau = 0;
endif
if nargin<4
order = 0;
endif
if nargin<5
packed=1;
endif
[n,m] = size(A_u); # Size of composite A_u matrix
N = m; # Number of U* functions per input
nm = n/m;
if (nm != n_u)&&(n!=m) # Check consistency
|
|
>
>
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
function Ustar = ppp_ustar (A_u,n_u,tau,order,packed,n_zero)
## usage: Us = ppp_ustar(A_u,n_u,tau,order,packed)
##
## Computes the U* matrix at time tau in terms of A_u
## n_u : Number of system inputs
## If tau is a vector, computes U* at each tau and puts into a row vector:
## If packed==1
## Ustar = [Ustar(tau_1) Ustar(tau_2) ...]
## else Ustar = [Ustar(tau_1); Ustar(tau_2) ...]
## n_zero extra zero columns appended
## Copyright (C) 1999 by Peter J. Gawthrop
## $Id$
if nargin<2
n_u = 1;
endif
if nargin<3
tau = 0;
endif
if nargin<4
order = 0;
endif
if nargin<5
packed=1;
endif
if nargin<6
n_zero=0;
endif
[n,m] = size(A_u); # Size of composite A_u matrix
N = m; # Number of U* functions per input
nm = n/m;
if (nm != n_u)&&(n!=m) # Check consistency
|
56
57
58
59
60
61
62
63
64
|
if (packed==1)
Ustar = [Ustar ustar];
else
Ustar = [Ustar; ustar];
endif
endfor
endfunction
|
>
>
>
>
|
|
62
63
64
65
66
67
68
69
70
71
72
73
74
|
if (packed==1)
Ustar = [Ustar ustar];
else
Ustar = [Ustar; ustar];
endif
endfor
if (n_zero>0)
[N,M] = size(Ustar);
Ustar = [Ustar zeros(N, n_zero)];
endif
endfunction
|