Index: mttroot/mtt/lib/control/PPP/ppp_ustar.m ================================================================== --- mttroot/mtt/lib/control/PPP/ppp_ustar.m +++ mttroot/mtt/lib/control/PPP/ppp_ustar.m @@ -1,15 +1,17 @@ -function Ustar = ppp_ustar (A_u,n_u,tau,order,packed) +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; @@ -24,10 +26,14 @@ 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; @@ -58,7 +64,11 @@ else Ustar = [Ustar; ustar]; endif endfor - + if (n_zero>0) + [N,M] = size(Ustar); + Ustar = [Ustar zeros(N, n_zero)]; + endif + endfunction