function mu_con

% MU_CON Show the help for the functions in this toolbox.

% This file is automatically generated.  Matthew Simoneau, 09-04-98
% Copyright (c) 1984-98 by The MathWorks, Inc. All Rights Reserved
% $Revision: 1.8 $ $Date: 1998/10/16 23:19:24 $

helpwin('mu_con/Contents');

function Contents
%MATLAB Tour Partial Function Help:  mu_con
%
%Double click on any function for more information
%
%  Mu-Analysis and Synthesis Toolbox.
%  Version 3.0.4 (R11) 10-Apr-1998
% 
%  New Features.
%    Readme      - Important release information about the Mu-analysis and 
%                  Synthesis Toolbox (double click on Readme, or type 
%                  "whatsnew directoryname", i.e. "whatsnew mutools/commands" 
%                  to display this file).
% 
%  Standard Operations/Basic Functions
% 
%     abv       - Stack constant/varying/system matrices above one another
%     cjt       - Conjugate transpose of varying/system matrices
%     daug      - Diagonal augmentation of constant/varying/system matrices
%     madd      - Addition of constant/varying/system matrices
%     minv      - Inverse of constant/varying/system matrices
%     mmult     - Multiplication of constant/varying/system matrices
%     mscl      - Scale (by a scalar) a system or varying matrix
%     msub      - Subtraction of constant/varying/system matrices
%     sbs       - Stack matrices next to one another
%     sclin     - Scale system input
%     sclout    - Scale system output
%     sel       - Select rows/columns or outputs/inputs
%     starp     - Redheffer star product
%     transp    - Transpose of varying/system matrices
% 
%  Matrix Information, Display and Plotting
% 
%     drawmag   - Interactive moused-based sketch and fitting tool
%     minfo     - Information on a matrix
%     mprintf   - Formatted printing of a matrix
%     rifd      - Display real, imaginary, frequency and damping data
%     see       - Display varying/system matrices
%     seeiv     - Display independent variables of a varying matrix
%     seesys    - Formatted varying/system display
%     vplot     - Plot a varying matrix
%     vzoom     - Mouse driven axis selection of plot window
%     wsgui     - Graphical workspace manipulation tool
% 
%  Modeling Functions
% 
%     fitsys    - Fit frequency response data with transfer function
%     nd2sys    - Convert a SISO transfer function into a system matrix
%     pck       - Create a system matrix from state-space data (A, B, C, D)
%     pss2sys   - Convert an [A B;C D] matrix into a mu-tools system matrix
%     sys2pss   - Extract state-space matrix [A B; C D] from a system matrix
%     sysic     - System interconnection program
%     unpck     - Extract state-space data (A,B,C,D) from a system matrix
%     zp2sys    - Convert transfer function poles and zeros to a system matrix
% 
%  System Matrix Functions
% 
%     reordsys  - Reorder states in a system matrix
%     samhld    - Sample-hold approximation of a continuous system
%     spoles    - Poles of system matrix
%     statecc   - Apply a coordinate transformation to system matrices
%     strans    - Bidiagonal coordinate transformation of system matrices
%     sysrand   - Generate a random system matrix
%     szeros    - Transmission zeros of a system matrix
%     tustin    - Prewarped continuous to discrete system transformation
% 
%  Model Reduction Functions
% 
%     hankmr    - Optimal Hankel norm approximation of a system
%     sdecomp   - Decompose a system matrix into two system matrices
%     sfrwtbal  - Frequency weighted balanced realization of a system matrix
%     sfrwtbld  - Stable frequency weighted realization of a system matrix
%     sncfbal   - Balanced realization of coprime factors of a system matrix
%     srelbal   - Stochastic balanced realization of a system matrix
%     sresid    - Residualize states of a system matrix
%     strunc    - Truncate states of a system matrix
%     sysbal    - Balanced realization of a system matrix
% 
%  System Response Functions
% 
%     cos_tr    - Generate a cosine signal as a varying matrix
%     dtrsp     - Discrete time response of a linear system
%     frsp      - Frequency response of a system matrix
%     sin_tr    - Generate a sine signal as a varying matrix
%     sdtrsp    - Sample data time response of a linear system
%     siggen    - Generate a signal as a varying matrix
%     simgui    - Graphical linear system simulation tool
%     step_tr   - Generate a step signal as a varying matrix
%     trsp      - Time response of a linear system
% 
%  H_2 and H_infinity Analysis and Synthesis Functions
% 
%     dhfsyn    - Discrete time H-infinity control design
%     dhfnorm   - Calculate discrete time infinity-norm of a stable system
%     emargin   - gap metric robust stability
%     gap       - Calculate the gap metric between systems
%     h2norm    - Calculate 2-norm of a stable, strictly proper system
%     h2syn     - H_2 control design
%     hinffi    - H_infinity full information control design
%     hinfnorm  - Calculate H_infinity norm of a stable, proper system
%     hinfsyn   - H_infinity control design
%     hinfsyne  - H_infinity, minimum entropy control design
%     linfnorm  - calculates L_infinity norm of proper system
%     ncfsyn    - H_infinity loopshaping control design
%     nugap     - Calculate the nu-gap metric between systems
%     pkvnorm   - Peak (across Independent variable) norm of varying matrix
%     sdhfsyn   - Sampled-data H_infinity (induced L_2 norm) control design
%     sdhfnorm  - Sampled-data H_infinity-norm (induced L_2) of stable system
% 
%  Structured Singular Value (mu) Analysis and Synthesis
% 
%     blknorm   - Block norm of constant/varying matrices
%     cmmusyn   - Constant matrix, mu-synthesis
%     dkit      - Automated D-K iteration
%     dkitgui   - Graphical DK iteration Tool
%     dypert    - Create a rational perturbation from frequency mu data
%     fitmag    - Fit magnitude data with real, rational, transfer function
%     fitmaglp  - Fit magnitude data with real, rational, transfer function
%     genmu     - Upper bound for Generalized-Mu
%     genphase  - Generate a minimum phase frequency response to magnitude data
%     magfit    - Fit magnitude data with real, rational, transfer function
%     msf       - D-scale fitting for DK iteration
%     msfbatch  - Batch version of msf
%     mu        - mu-analysis of constant/varying matrices
%     muftbtch  - Batch D-scale fit routine (grandfathered - use msfbatch)
%     musynfit  - Interactive D-scale rational fit (grandfathered - use msf)
%     musynflp  - Interactive D-scale rational fit (grandfathered - use msf)
%     muunwrap  - extract data from mu calculation
%     randel    - Generate a random perturbation
%     sisorat   - First order, all-pass interpolation
%     unwrapd   - Construct D scaling from mu
%     unwrapp   - Construct Delta perturbation from mu
%     wcperf    - Worst-Case performance curves and perturbations
% 
%  Varying Matrix Manipulation
% 
%     getiv     - Get the independent variable of a varying matrix
%     indvcmp   - Compare the independent variable data of two matrices
%     massign   - Assign elements of a matrix
%     scliv     - Scale the independent variable
%     sortiv    - Sort the independent variable
%     tackon    - String together varying matrices
%     var2con   - Convert a varying matrix to a constant matrix
%     varyrand  - Generate a random varying matrix
%     vpck      - Pack a varying matrix
%     vunpck    - Unpack a varying matrix
%     xtract    - Extract portions of a varying matrix
%     xtracti   - Extract portions of  a varying matrix
% 
%  Standard MATLAB Commands for Varying Matrices
% 
%     vabs      - Absolute value of a constant/varying matrix
%     vceil     - Round elements of  constant/varying matrices towards infinity
%     vdet      - Determinant of constant/varying matrices
%     vdiag     - Diagonal of  constant/varying matrices
%     veig      - Eigenvalue decomposition of constant/varying matrices
%     vexpm     - Exponential of  constant/varying matrices
%     vfft      - FFT for varying matrices
%     vfloor    - Round elements of  constant/varying matrices towards -infinity
%     vifft     - Inverse FFT for varying matrices
%     vinv      - Inverse of a constant/varying matrix
%     vimag     - Imaginary part of a constant/varying matrix
%     vnorm     - Norm of varying/constant matrices
%     vpoly     - Characteristic polynomial of constant/varying matrices
%     vpinv     - Pseudoinverse of a constant/varying matrix
%     vrank     - Rank of a constant/varying matrix
%     vrcond    - Condition number of a constant/varying matrix
%     vreal     - Real part of a constant/varying matrix
%     vroots    - Polynomial roots of constant/varying matrices
%     vschur    - Schur form of a constant/varying matrix
%     vspect    - Signal Processing spectrum command for varying matrices
%     vsqrtm    - Matrix square root for constant/varying matrices
%     vsvd      - Singular value decomposition of a constant/varying matrix
% 
%  Additional Varying Matrix Functions
% 
%     vcjt      - Conjugate transpose of constant/varying matrices
%     vcond     - Condition number of constant/varying matrices
%     vconj     - Complex conjugate of constant/varying matrices
%     vdcmate   - Decimate varying matrices
%     vebe      - Element-by-element operations on varying matrices
%     veberec   - Element-by-element reciprical
%     veval     - Evaluate general functions of varying matrices
%     vveval    - Evaluate general functions of varying matrices
%     mveval    - Evaluate general functions of varying matrices
%     vfind     - Find across independent variable
%     vinterp   - Interpolate varying matrices
%     vldiv     - Left division of constant/varying matrices
%     vrdiv     - Right division of constant/varying matrices
%     vrho      - Spectral radius of a constant/varying matrix
%     vtp       - Transpose of constant/varying matrices
%     vtrace    - Trace of constant/varying matrices
% 
%  Utilities and Miscellaneous Functions
% 
%     add_disk  - Adds unit disk to the Nyquist plot
%     cf2sys    - Create matrix from normalized coprime factors
%     clyap     - Continuous Lyapunov equation
%     crand     - Complex random matrix generator, uniform
%     crandn    - Complex random matrix generator, normalized
%     csord     - Order complex Schur form matrices
%     mfilter   - Create Butterworth, Bessel, RC filters
%     negangle  - Calculate angle of matrix elements between 0 and -2 pi
%     ric_eig   - Solve a Riccati equation via eigenvalue decomposition
%     ric_schr  - Solve a Riccati equation via real Schur decomposition
%     unum      - input dimension
%     xnum      - state dimension
%     ynum      - output dimension
% 
%-------------------------------------------
%
%  Mu-Analysis and Synthesis Toolbox.
% 
%  Mat Files
% 
% 	F14_nom.mat	- Example file used by ex_f14ic ex_f14s1 ex_f14tp ex_f14wt
% 	ss_cont.mat	- Example file
% 
%  Example Files
% 
% 	ex1		- Example file
% 	ex1d		- Example file
% 	ex1t		- Example file
% 	ex_f14ic	- Example file
% 	ex_f14mu	- Example file
% 	ex_f14s1	- Example file
% 	ex_f14s2	- Example file
% 	ex_f14tp	- Example file
% 	ex_f14wt	- Example file called by ex_f14ic
% 	ex_mkclp	- Example file
% 	ex_mkpl		- Example file
% 	ex_ml1		- Example file
% 	ex_mmmk		- Example file called by mimo_margs
% 	ex_unc		- Example file
% 	ex_unic		- Example file
% 	ex_uspl		- Example file
% 	ex_usrp		- Example file
% 	ex_usti		- Example file
% 	ex_usti2	- Example file
% 	ex_ustr		- Example file called by ex_ustr2 ex_ustrd
% 	ex_ustr2	- Example file
% 	ex_ustrd	- Example file
% 	ex_wcp		- Example file
% 	formloop	- generic feedback loop interconnect, used in examples
% 	fow		- make first-order weight, used in examples
% 	gainph_ex	- Example file
% 	himat_de	- Example file
% 	himat_dk	- Example file
% 	himatic		- Example file called by mhimatic
% 	mhimatic	- Example file
% 	mimo_margs	- Example file
% 	mk_acnom	- Example file called by mk_olic mk_olsim
% 	mk_act		- Example file called by mk_olic mk_olsim
% 	mk_olic		- Example file
% 	mk_olsim	- Example file
% 	mk_pert		- Example file
% 	mk_wts		- Example file called by mk_olic mk_olsim
% 	mkhic		- Example file
% 	mkhicn		- Example file
% 	mkhimat		- Example file
% 	mkklp		- Example file
% 	mloop_ma	- Example file
% 	msdemo1		- Example file
% 	msdemo2		- Example file
% 	muexamp		- Example file
% 	olhimic		- Example file
% 	reducek		- simple controller order reduction, used in examples
% 	rsexamp		- Example file
% 	rsexamp_crc	- Example file
% 	ssic		- Example file called by tssic
% 	tankdemo	- Example file
% 	trsp_ex		- Example file
% 	tssic		- Example file
% 
%  CMEX source & dummies
% 
% 	amevlp.c	- CMEX executable called by genmu mu bub bubd gebub gebubd
% 	amevlp		- dummy m-file to cover missing amevlp.c
% 	amhxv.c		- c subroutine called by amevlp.c
% 	amhxy.c		- C subroutine called by amevlp.c
% 	amhxz.c		- C subroutine called by amevlp.c
% 	amhyv.c		- C subroutine called by amevlp.c
% 	amhyz.c		- C subroutine called by amevlp.c
% 	amhzv.c		- C subroutine called by amevlp.c
% 	amibndv.c	- CMEX executable called by genmu mu bub bubd gebub gebubd
% 	amibndv		- dummy m-file to cover missing amibndv.c
% 	amilowxy.c	- CMEX executable called by genmu mu bub bubd gebub gebubd
% 	amilowxy	- dummy m-file to cover missing amilowxy.c
% 	amiuppxy.c	- CMEX executable called by genmu mu bub bubd gebub gebubd
% 	amiuppxy	- dummy m-file to cover missing amiuppxy.c
% 	amxyzv.c	- C subroutine called by atxa.c
% 	atxa.c		- C subroutine called by amxyzv.c
% 	ghvvcp.c	- C subroutine called by amevlp.c
% 	ghxxc.c		- C subroutine called by amevlp.c
% 	ghyyc.c		- C subroutine called by amevlp.c
% 	ghzzc.c		- C subroutine called by amevlp.c
% 
%  Dedicated subroutines to Commands
% 
% 	a2ynrow		- called by mu genmu
% 	addrunf		- called by wsguin
% 	agv2str		- called by dkitgui dtrsp sdtrsp trsp dkparmcb parmwin tabed
% 	allocpim	- called by mu amiq2sol bub bubd gebub gebubd
% 	amiq2sol	- called by bub bubd gebub gebubd
% 	autod		- called by tankdemo
% 	axxbc		- called by h2norm sdecomp ham2schr
% 	bilins2z	- called by dhfsyn dhfsyn
% 	bilinz2s	- called by dhfnorm dhfsynp_c sdhfnorm sdn_step
% 	blknrms		- called by blknorm
% 	bub		- called by genmu mu
% 	bubd		- called by genmu mu
% 	cgivens		- called by csord
% 	chhsparm	- called by dkit
% 	chomega		- called by dkit
% 	chstr		- called by pass2
% 	co2di		- called by fitsys msf msfbatch
% 	colbut		- called by dkitgui dataent
% 	comple		- called by many programs
% 	compnorm	- called by sdhfnorm sdhfsyn
% 	dand		- called by rub
% 	dang		- called by rub
% 	dataent		- called by dkitgui simgui dk_able gdataent
% 	dcalc		- called by hankmr
% 	deebal		- called by rub
% 	deladdc		- called by simgui
% 	delrunf		- called by dkitgui wsguin
% 	dfitgui		- called by dkitgui dfitgui
% 	dhinf_p		- called by dhfsynf
% 	di2co		- called by fitsys msf msfbatch
% 	dk_able		- called by dkitgui dfitgui dkparmcb dkychose omframe rready
% 	dk_defin	- called by dkit himat_de
% 	dkdispla	- called by dkit
% 	dkparmcb	- called by dkitgui
% 	dkuchose	- called by dkitgui
% 	dkychose	- called by dkitgui
% 	dypertsb	- called by dypert
% 	extsmp		- called by fitsys msf msfbatch
% 	findmuw		- called by dkit dkitgui simgui vplot addrunf delrunf wsguin
% 	findrunf	- finds all running MU-GUIS
% 	findsys		- called by pass2
% 	fitchose	- called by msf
% 	flatten		- called by genphase
% 	fmfixbas	- called by fmlinp mffixbas
% 	fminfo		- called by wsminfo
% 	fmlp		- called by fmlinp
% 	gaino		- called by sysic
% 	gcnvert		- called by gebub gebubd
% 	gdataent	- called by simgui
% 	gdataevl	- called by dkitgui simgui dataent gdataent
% 	gebub		- called by genmu
% 	gebubd		- called by genmu
% 	geestep		- called by rub
% 	genlft		- called by starp redstar
% 	geosplit	- called by hinfnorm linfnorm
% 	gguivar		- Get GUI variable, called by many programs
% 	gjb2		- called by simgui scrolltb
% 	goptvl		- called by genmudiagnose mudiagnose rub
% 	gpredict	- called by hinfsyn
% 	grabvar		- called by mkdragic
% 	h2v		- called by simgui gguivar mkmulink sguivar
% 	ham2schr	- called by sdhfnorm sdhfsyn sdequiv
% 	helpxpii	- called by bub bubd gebub gebubd
% 	hinf_c		- called by hinfsyn[k] hinfe_c
% 	hinf_gam	- called by hinfsyn hinfsyne
% 	hinf_sp		- called by hinf_c hinf_gam hinf_st hinfe_c
% 	hinf_st		- called by hinfsyn hinfsyne
% 	hinfchk		- called by hinfnorm sdn_step
% 	hinfe_c		- called by hinfsyne[ka]
% 	hinffi_c	- called by hinffi[k]
% 	hinffi_g	- called by hinffi
% 	hinffi_p	- called by hinffi hinffi_c hinffi_g hinffi_t
% 	hinffi_t	- called by hinffi
% 	inpstuff	- called by sysic
% 	ipii		- Insert Packed Index Item
% 	jwhamtst	- called by hinfchk
% 	kfm		- delete all figures, and clear muTools globals
% 	ksum		- called by fitmag fitmaglp sclout sel autod dfitgui
% 	lamb		- called by rub
% 	ldpim		- called by minfo allocpim fminfo helpxpii ipii ldpim xpii
% 	linp		- called by magfit
% 	looptst		- called by fitmag fitmaglp
% 	mamilc		- called by bub bubd gebub gebubd
% 	mamiscl		- called by bub bubd gebub gebubd mamilc
% 	mdipii		- called by simgui
% 	mdpimdel	- called by simgui
% 	mdxpii		- called by simgui mdpimdel tabed
% 	mffixbas	- called by mflinp
% 	mflinp		- called by magfit
% 	mflp		- called by mflinp
% 	mhhparms	- called by dkit
% 	mkdragic	- called by scrtxtn
% 	mkdragtx	- called by dkitgui simgui wsguin
% 	mkmulink	- called by dkitgui
% 	mknorm		- called by dkitgui simgui
% 	mkours		- called by dkitgui simgui findmuw
% 	mkth		- called by dfitgui
% 	mtblanks	- called by sysic inpstuff namstuff pass1 pass2
% 	muclear		- called by kfm
% 	mucnvert	- called by bub bubd mucnvert
% 	mudeclar	- called by dkitgui simgui wsguin
% 	mudkaf		- called by msf msfbatch
% 	muexport	- called by dkitgui simgui
% 	mvtext		- called by mkdragic
% 	namstuff	- called by sysic
% 	nd2ssms		- called by nd2sys
% 	newd		- called by rub
% 	newga		- called by rub
% 	newub		- called by rub
% 	nicetod		- called by wsguicb wsguin
% 	notherdk	- called by dkit
% 	ocsf		- called by sncfbal srelbal
% 	omegavl		- called by dkitgui
% 	omframe		- called by dkitgui
% 	onealpha	- called by wcperf
% 	oniter		- called by dkitgui
% 	orsf		- called by sdecomp sncfbal srelbal
% 	ourslid		- called by scrolltb tabed
% 	parmwin		- called by dkitgui simgui gdataent wsguin
% 	pass1		- called by sysic
% 	pass2		- called by sysic
% 	pass3		- called by sysic
% 	prefit		- called by dkitgui dfitgui
% 	ptrs		- called by mu and subroutines
% 	pullaprt	- called by wsguic
% 	qrsc		- called by sjh6
% 	redstar		- called by starp redstar
% 	reindex		- called by dypert mu muunwrap unwrapp
% 	reomega		- called by dkit
% 	rerunhi		- called by dkit
% 	rready		- called by dkitgui omframe
% 	rub		- called by dypert mu
% 	rubind		- called by dypert mu muunwrap unwrapp
% 	rublow		- called by rub
% 	rupert		- called by rublow
% 	ruqvsol		- called by cmmusyn genmu
% 	ruqvsolb	- called by cmmusyn
% 	sclmublk	- called by sclmublk
% 	scrolltb	- called by dkitgui simgui dfitgui rready
% 	scrtxtn		- called by dkitgui simgui wsguin
% 	sdequiv		- called by sdhfsyn sdn_step
% 	sdn_step	- called by sdhfnorm
% 	seesub		- called by seesys
% 	sguivar		- Set GUI variable, called by many programs
% 	sigmaub		- called by mu mu sigmaub sigmaub
% 	sim2str		- called by sim2str sim2str
% 	simplemu	- called by simplemu
% 	simprmu		- called by simprmu
% 	sisoloop	- called by ex_ustr2
% 	sjh6		- called by clyap sncfbal srelbal sysbal
% 	sm2vec		- called by bub bubd gebub gebubd
% 	ssm2vec		- called by bub bubd gebub gebubd
% 	stripemp	- called by oniter
% 	swapiv		- Swap independent variables
% 	sylv		- called by h2norm axxbc
% 	syscl		- not called, may be used in debugging
% 	tabed		- called by dkitgui
% 	terpol		- called by dtrsp genphase sdtrsp trsp vinterp vterp
% 	terpolb		- called by genphase
% 	updownb		- called by simgui
% 	updownb2	- called by simgui
% 	var2sep		- called by mamilc
% 	vec2sm		- called by amiq2sol
% 	vec2ssm		- called by amiq2sol
% 	wsguic		- called by wsgui wsguin
% 	wsguicb		- called by wsguin
% 	wsguin		- called by wsgui
% 	wsminfo		- called by wsguin
% 	xpii		- Extract Packed Index Item
% 	ynftdami	- called by mu
% 	yublksel	- called by dkitgui
%

function abv
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = abv(mat1,mat2,mat3...,matN,[memstr])
% 
%    Stacks VARYING/SYSTEM/CONSTANT matrices above one another:
% 
%                           |  mat1  |
%                           |  mat2  |
%             out    =      |  mat3  |
%                           |   ..   |
%                           |  matN  |
% 
%    memstr is a string variable specifying whether or not
%    to minimize memory usage in executing the command.
%    If memstr = "min_mem" then VARYING matrices are stacked in a
%    for loop.  This is much slower but it uses less memory.
%    Use this feature when manipulating huge experimental data
%    files on machines with limited memory.
% 
%    

function cjt
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = cjt(mat)
% 
%    Complex conjugate transpose for VARYING matrices;
% 
%    Complex conjugate transpose (adjoint system) for
%       SYSTEM matrices.
% 
%    

function daug
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = daug(mat1,mat2,mat3...,matN,[memstr])
% 
%    Diagonal augmentation of SYSTEM/VARYING/CONSTANT,
%    matrices, currently limited to 9 input matrices.
% 
%             |  mat1  0     0    .   0   |
%             |   0   mat2   0    .   0   |
%       out = |   0    0    mat3  .   0   |
%             |   .    .     .    .   .   |
%             |   0    0     0    .  matN |
% 
%    memstr is a string variable specifying whether or not
%    to minimize memory usage in executing the command.
%    If memstr = "min_mem" then VARYING matrices are stacked in a
%    for loop.  This is much slower but it uses less memory.
%    Use this feature when manipulating huge experimental data
%    files on machines with limited memory.
% 
%    

function madd
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = madd(mat1,mat2,mat3,...,matN)
% 
%    Add SYSTEM/VARYING/CONSTANT matrices, currently limited
%    to 9 input arguments
% 
%    out = mat1 + mat2 + mat3 + ... + matN
% 
%    

function minv
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = minv(mat)
% 
%    Invert a SYSTEM/VARYING/CONSTANT matrix.
% 
%    

function mmult
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = mmult(mat1,mat2,mat3,...,matN)
% 
%    Multiplies SYSTEM/VARYING/CONSTANT matrices, currently
%    limited to 9 input arguments
% 
%    out = mat1*mat2*mat3* *** *matN
% 
%    

function mscl
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = mscl(mat,fac)
% 
%    Scale a SYSTEM/VARYING/CONSTANT by a scalar number.
%    In a SYSTEM matrix, this command scales the B and
%    D matrices by FAC
% 
% 	out = fac*mat
% 
%    

function msub
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = msub(mat1,mat2,...,matN)
% 
%    Subtract SYSTEM/VARYING/CONSTANT matrices, currently limited
%    to 9 input arguments.
% 
%    out = mat1 - mat2 - mat3 - ... - matN
% 
%    

function sbs
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = sbs(mat1,mat2,mat3,...,matN)
% 
%    Place SYSTEM/VARYING/CONSTANT matrices next to
%    one another. Currently limited to 9 input matrices.
%    All of the matrices must have the same number of
%    rows (outputs).
% 
%    out = [mat1  mat2  mat3  ...  matN]
% 
%    

function sclin
%MATLAB Tour Partial Function Help:  mu_con
%
%  function newsys = sclin(sys,inputs,fac)
% 
%    Scale specified inputs of a SYSTEM or CONSTANT
%    matrix by a scalar number FAC or a SISO SYSTEM.
%  or
%    Scale specified inputs of a VARYING
%    matrix by a scalar number FAC.
%  or
%    Scale specified inputs of a VARYING
%    matrix by a VARYING number FAC.
% 
%    

function sclout
%MATLAB Tour Partial Function Help:  mu_con
%
%  function newsys = sclout(sys,outputs,fac)
% 
%    Scale specified outputs of a SYSTEM or CONSTANT
%    matrix by a scalar number FAC or a SISO SYSTEM.
%  or
%    Scale specified outputs of a VARYING
%    matrix by a scalar number FAC.
%  or
%    Scale specified outputs of a VARYING
%    matrix by a VARYING number FAC.
% 
%    

function sel
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = sel(mat,rowdata,coldata)
% 
%    Selects rows and columns from a VARYING matrix.
%    Selects outputs and inputs from a SYSTEM matrix.
%    The string ':' is used to select all rows, or all columns.
% 
%    

function starp
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = starp(top,bot,dim1,dim2)
% 
%    Redheffer star-product of two SYSTEM/VARYING/CONSTANT
%    matrices. TOP represents the top matrix and BOT represents
%    the bottom matrix. DIM1 is the number of inputs to connect
%    to the BOT matrix and DIM2 is the number of outputs to the
%    TOP matrix. DIM1 and DIM2 are optional, if they are not
%    provided it is assumed that the desired interconnection
%    is a linear fractional transformations and the correct
%    inputs/outputs are closed.
% 
%                 _________
%        <-------|         |<--------
%                |   TOP   |
%            /---|_________|<---
%       dim1 |                 | dim2
%            |                 |
%            |                 |                 /---------\
%             \________________|___       <------|         |<-------
%                              |  |              |   OUT   |
%                              |  |       <------|         |<-------
%             _________________|  |              \_________/
%            /                    |
%            |   __________       |
%            |--|          |<-----/
%               |   BOT    |
%        <------|__________|<-------
% 
% 
%    

function transp
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = transp(mat)
% 
%    Transpose a VARYING matrix, or  dual of a SYSTEM matrix
% 
%    

function drawmag
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [sysout,pts] = drawmag(in,init_pts)
% 
%   Interactive mouse-based loglog sketching and fitting tool
% 
%    inputs:  in = either VARYING data which will be plotted each time
%   		or  CONSTANT specifying window on data [xmin xmax ymin ymax]
%             init_pts = VARYING file with initial points (optional)
% 
%    outputs: sysout = fitted SYSTEM
%             pts    = VARYING file with final points
% 
%   With the mouse in plot window the following keys are recognized
% 	-click mouse to add points ( may be added outside current window)
% 	-type 'a' to add points ( same as clicking mouse button)
% 	-type 'r' to remove nearest frequency point
% 	-enter integer (0-9) order for stable, minphase fit of points
% 	-type 'w' to window and click again to specify second window coordinate
% 	-type 'p' to replot
% 	-type 'g' to toggle grid
% 
%   

function minfo
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [mattype,rowd,cold,num] = minfo(mat)
%   or
%  function  minfo(mat)
% 
%    Return information about a matrix and provides a consistency
%    check for CONSTANT, SYSTEM and VARYING matrices.
% 
%    

function mprintf
%MATLAB Tour Partial Function Help:  mu_con
%
%  function mprintf(mat,form,endline)
% 
%    Uses MATLAB function FPRINTF to display real part of matrices.
%      inputs:
%              MAT  -  matrix to be printed
%              FORM -  format, see MATLAB manual for SPRINTF and
%                      FPRINTF, default is '%2.1e '.  (optional)
%              ENDLINE - characters to go at end of line,
% 		        default is '\n' (optional)
% 
%    

function rifd
%MATLAB Tour Partial Function Help:  mu_con
%
%  function rifd(vec)
% 
%    Displays the real, imaginary, frequency (magnitude) and
%    damping ratios (-real/magnitude) of the input vector VEC.
% 
%    

function see
%MATLAB Tour Partial Function Help:  mu_con
%
%  function see(mat,iv_low,iv_high)
% 
%    Display a specified range of a VARYING matrix or
%    display state-space entries of a SYSTEM matrix
% 
%    

function seeiv
%MATLAB Tour Partial Function Help:  mu_con
%
%  function seeiv(mat)
% 
%    Display the INDEPENDENT VARIABLE's values.
% 
%    

function seesys
%MATLAB Tour Partial Function Help:  mu_con
%
%  function seesys(mat,form)
% 
%    Uses MATLAB function FPRINTF to print real part of matrices.
%    Primarily intended for printing system matrices.
%      inputs
%             MAT   - matrix to be printed
%             FORM  - format, see MATLAB manual for SPRINTF and FPRINTF
% 
%    

function vplot
%MATLAB Tour Partial Function Help:  mu_con
%
%  function vplot([plot_type],vmat1,vmat2,vmat3, ...)
%  function vplot([plot_type],vmat1,'linetype1',vmat2,'linetype2',...)
%  function vplot('bode_l',toplimits,bottomlimits,vmat1,vmat2,vmat3, ...)
% 
% 
%    Plot one or more varying matrices.  The syntax is
%    the same as the MATLAB plot command except that all data
%    is contained in VMATi, and the axes are specified by PLOT_TYPE.
% 
%    The (optional) plot_type argument must be one of:
% 
%       'iv,d'       matin .vs. independent variable (default option)
%       'iv,m'       magnitude .vs. independent variable
%       'iv,lm'      log(magnitude) .vs. independent variable
%       'iv,p'       phase .vs. independent variable
%       'liv,d'      matin .vs. log(independent variable)
%       'liv,m'      magnitude .vs. log(independent variable)
%       'liv,lm'     log(magnitude) .vs. log(independent variable)
%       'liv,p'      phase .vs. log(independent variable)
%       'ri'         real .vs. imaginary  (parametrized by indep variable)
%       'nyq'        real .vs. imaginary  (parametrized by indep variable)
%       'nic'        Nichols chart
%       'bode'       Bode magnitude and phase plots
%       'bode_g'     Bode magnitude and phase plots with grids
%       'bode_l'     Bode magnitude and phase plots with axis limits
%       'bode_gl'    Bode magnitude and phase plots with axis limits
%                    and grids
% 
%    In th 'bode_l' and 'bode_gl' plot types the 2nd and 3rd arguments
%    are the top and bottom axis limit vectors.  For example:
% 
%              vplot('bode_gl',[-1,1,-3,1],[-1,1,-180,0],...
% 
%     

function vzoom
%MATLAB Tour Partial Function Help:  mu_con
%
% function vzoom('axis')
% 
%    VZOOM freezes axis by clicking on 2 points in the plot.
%    STR is a string variable:
% 	'ss'  standard plot  (default)
% 	'll'  log-log
% 	'ls'  semilogx
% 	'sl'  semilogy
% 
%    Also, STR can be any allowable input to VPLOT, except 'bode'.
%      Example:
%               tf = frsp(nd2sys([ 1 .1],[.1 1]),logspace(-2,2,100));
% 	       vplot('nic',tf); vzoom('nic'); vplot('nic',tf);axis;
% 
%    

function wsgui
%MATLAB Tour Partial Function Help:  mu_con
%
%  wsgui: Main program for Workspace Tool

function fitsys
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sys = fitsys(frdata,order,weight,code,idnum,discflg)
% 
%    FITSYS fits frequency response data in FRDATA
%    with a transfer function of order ORDER, using a
%    frequency dependent weight in WEIGHT (optional).
% 
%    FRDATA : VARYING matrix of given frequency response data.
%             This must be a VARYING row or column matrix.
%    ORDER  : order of the SYSTEM matrix to fit data.
%    WEIGHT : VARYING/SYSTEM/CONSTANT matrix,
%             used as weighting in the least-squares fitting (default=1)
%    CODE   : 0 - no restriction on pole location of SYS (default)
%             1 - restrict SYS to be stable, minimum-phase, requires
%                    FRDATA to be 1x1 VARYING matrix
%             2 - constrain rational fit so that SYS is stable
%    IDNUM  : number of LS iterations (default = 2)
%    DISCFLG: If DISCFLG==1 (default=0) then all frequency data is
%             interpreted as unit disk data, and SYS should be interpreted
%             as discrete-time.  If DISCFLG==0, then the frequency data is
%             interpreted as imaginary axis, and SYS is interpreted as continuous
%             time.
% 
%    The fourth argument, CODE, is optional. If CODE==0 (default)
%    then the rational fit is unconstrained.
%    If CODE == 1, as in the mu-synthesis routines, it
%    forces the rational fit to be stable, minimum phase,
%    by simply doing a spectral factorization on the answer.
%    Typically in this case, the response FRDATA comes from
%    the program GENPHASE, and already corresponds to a
%    stable, minimum phase transfer function.
% 
%    

function nd2sys
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sys = nd2sys(num,den,gain)
% 
%    ND2SYS converts a numerator/denominator single-input/
%    single-output transfer function into a SYSTEM matrix.
%    GAIN is an optional argument that scales the output SYS.
% 
%    

function pck
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sys = pck(a,b,c,d)
% 
%    Pack state-space data into a SYSTEM matrix
% 
%    

function pss2sys
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sys = pss2sys(mat,n)
% 
%    Converts a CONSTANT matrix into a SYSTEM matrix with n
%    states. assumes that the constant matrix has the state
%    space data in the form  mat = [A B;C D], and that the
%    matrix A is n x n.
% 
%    

function sys2pss
%MATLAB Tour Partial Function Help:  mu_con
%
%  function mat = sys2pss(sys)
% 
%    Unpacks a SYSTEM matrix into a packed matrix,
%     MAT = [A B; C D];
% 
%    

function sysic
%MATLAB Tour Partial Function Help:  mu_con
%
%  SYSIC is a M-file used to form interconnections of SYSTEM
%    matrices (it also works for interconnections of VARYING
%    matrices). A number of variables need to be in the workspace
%    to run SYSIC. These are explained in the manual.
% 
%    

function unpck
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [a,b,c,d] = unpck(sys)
% 
%    Unpacks a SYSTEM matrix into its 4 separate
%    state-space entries.
% 
%    

function zp2sys
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sys = zp2sys(zeros,poles,gain)
% 
%    Similar to the MATLAB ZP2SS command; takes
%    ZEROS, POLES and GAIN data, and converts this into a
%    single-input, single-output SYSTEM matrix.
% 
%    

function reordsys
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sysout = reordsys(sys,index);
% 
%    Reorders the states of the SYSTEM matrix SYS as defined
%    by position variables in INDEX. The INDEX variable must be
%    of the same size as the number of states of SYS.
% 
%    

function samhld
%MATLAB Tour Partial Function Help:  mu_con
%
%  function discout = samhld(sys,T)
% 
%    SAMHLD applies a sample-hold to the input of the continuous
%    time systems SYS, and samples the output, to produce a
%    discrete time system, DISCOUT. The sampling time is the
%    same at the input and output, and is specified by T.
% 
%    

function spoles
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = spoles(sys)
% 
%    Eigenvalues of the A matrix of a SYSTEM matrix.
% 
%    

function statecc
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sysout = statecc(sysin,t)
% 
%    Applies a state coordinate transformation to the
%    system matrix, yielding a new system matrix with:
% 
%        sysout = pck(inv(t)*a*t,inv(t)*b,c*t,d)
% 
%    

function strans
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [sysout,v] = strans(sys)
% 
%    STRANS puts the A matrix in bidiagonal form
%    with the complex conjugate roots in two by two form.
%    SYSOUT contains the transformed SYSTEM matrix and
%    V is the transformation matrix.
% 
%    

function sysrand
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = sysrand(nstates,noutputs,ninputs,flg_stab)
% 
%   Create a random SYSTEM matrix (using a normally distributed set
%    of random numbers), with a specified number of states,
%    inputs and outputs. Setting FLG_STAB = 1 results in a stable,
%    random SYSTEM matrix. (Default is FLG_STAB = 0.)
% 
%    

function szeros
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = szeros(sys,epp)
% 
%    Finds the transmission zeros of a SYSTEM matrix.
%    Occasionally, large zeros are included which may
%    actually be at infinity. Solving for the transmission
%    zeros of a system involves two generalized eigenvalue
%    problems. EPP (optional) defines if the difference between
%    two generalize eigenvalues is small.
% 
%    

function tustin
%MATLAB Tour Partial Function Help:  mu_con
%
% function dsys = tustin(csys,T,prewarpf);
% 
%    Perform a continuous (CSYS) to discrete (DSYS) conversion
%    by the prewarped Tustin method.  T is the sample time
%    (in seconds) and PREWARP is the prewarp frequency in
%    rad/sec. If no prewarp frequency is specified, a standard
%    bilinear transformation is performed.
% 
%    

function hankmr
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [sh,su,hsvu]=hankmr(sys,sig,k,opt)
% 
%    Performs an optimal Hankel norm approximation of order K
%    on the state-space system SYS of order n. The input system
%    SYS must be a balanced realization with Hankel singular
%    values SIG (i.e. SYS and SIG must be the output of SYSBAL).
%    OPT may be omitted or
% 
%      -set to 'a' to stop with an anti-causal term. The anticausal
%          part will be absorbed into SH, and SU = 0.
%      -set to 'd' to calculate a D-term which satisfies
%          the H infinity error bound the sum of the neglected
%          Hankel singular values SIG(i). That is SH+SU will always
%          be an optimal H infinity norm approximation to SYS with
%          K stable poles.
% 
%    The anticausal will be absorbed into SH, and SU = 0, if OPT = 'a',
%    otherwise SU contains the anticausal term and SH the Kth order
%    causal system. With the 'd' option the Hankel singular values
%    of SU are given in HSVU.
% 
%    

function sdecomp
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [sysst,sysun] = sdecomp(sys,bord,fl)
% 
%    Decomposes a system into the sum of two systems,
%       SYS = MADD(SYSST,SYSUN).
%       SYSST has the real parts of all its poles < BORD
%       SYSUN has the real parts of all its poles >= BORD
%       BORD has default value 0.
% 
%     The D matrix for SYSUN is zero unless FL = 'd' when
%     that for SYSST is zero.
% 
%    

function sfrwtbal
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [sys1,sig1] = sfrwtbal(sys,wt1,wt2);
% 
%    Calculates the stable part of MINV(WT1~)*SYS*MINV(wt2~)
%    and then SYS1 is a balanced realization of this, with
%    Hankel singular values SYS1. WT1 and WT2 must be stable
%    and minimum phase, square and of compatible dimensions with
%    SYS.  WT2 has the identity as default value and  SYS must
%    be stable.
% 
%    SYS1(k) gives a lower bound on the achievable H-infinity
%    norm of the error MINV(WT1~)*(SYS-SYSHAT)*MINV(WT2~)
%    where SYSHAT is stable of degree K.  The routine is used
%    with SFRWTBLD to obtain a possible SYSHAT as follows:
% 
%      >>[sys1,sig1] = sfrwtbal(sys,wt1,wt2);
%      >>sys1hat = strunc(sys1,k);
%    or
%      >>sys1hat = hankmr(sys1,sig1,k);
%      >>syshat = sfrwtbld(sys1hat,wt1,wt2);
% 
%    The resulting error can be assessed with a direct frequency
%    response calculation.
% 
%    

function sfrwtbld
%MATLAB Tour Partial Function Help:  mu_con
%
%  function syshat = sfrwtbld(sys,wt1,wt2)
% 
%    Calculate the stable part of (WT1~)*SYS*(WT2~)
%    The routine is used with SFRWTBAL to obtain a possible
%    SYSHAT as follows:
% 
%     >>[sys1,sig1] = sfrwtbal(sys,wt1,wt2);
%     >>sys1hat = strunc(sys1,k)
%    or
%     >>sys1hat = hankmr(sys1,sig1,k)
%     >>syshat = sfrwtbld(sys1hat,wt1,wt2);
% 
%    The resulting error can be assessed with a direct frequency
%    response calculation.
% 
%    

function sncfbal
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [sysnlcf,sig,sysnrcf] = sncfbal(sys,tol)
% 
%    Finds a (truncated)  balanced realization of the normalized 
%    left and right coprime factors of the system state-space 
%    model SYS. The state-space models in SYSNLCF and SYSNRCF
%    are both balanced realizations with Hankel singular values 
%    given by SIG.  
%  
%     SYSNLCF = [Nl Ml] and Nl Nl~ + Ml Ml~ = I, SYS = Ml^(-1) Nl.
%     SYSNRCF = [Nr;Mr] and Nr~ Nr + Mr~ Mr = I, SYS = Nr Mr^(-1).
% 
%    The results are truncated to retain all Hankel singular values 
%    greater than TOL. If TOL is omitted then it is set to 
%    MAX(SIG(1)*1.0E-12,1.0E-16). A warning message is printed out 
%    if SYS is close to being undetectable, in which case the output 
%    may be unreliable.
% 
%    

function srelbal
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [sysout,sig,sysfact] = srelbal(sys,tol)
% 
%    Find a truncated stochastically balanced realization of
%    the system state-space model SYS.  All the eigenvalues
%    of SYS must have negative real part. The result is
%    truncated to retain all Hankel singular values greater
%    than TOL.  The output parameter SYSFACT is a stable
%    minimum phase system such that SYS~*SYS = SYSFACT*SYSFACT~.
%    If TOL is omitted then it is set to max(SIG(1)*1.0E-12,1.0E-16).
%    SIG imply the achievable relative errors with STRUNC(SYSOUT,K).
% 
%    

function sresid
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sysout = sresid(sys,ord)
% 
%    Residulizes the input SYSTEM SYS of order N to a SYSTEM, SYSOUT
%    of order ORD.  SRESID assumes that the system matrix has been
%    ordered such that the last (N-ORD) states are to be residulized.
% 
%    

function strunc
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sysout = strunc(sys,ord)
% 
%    Truncates the state dimension of a SYSTEM
%    matrix to ORD states, by eliminating rows
%    and columns of the state matrices.
% 
%    

function sysbal
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [sysout,sig] = sysbal(sys,tol)
% 
%    Finds a truncated balanced realization of the system
%    state-space model. Eigenvalues of A must have negative
%    real part. The result is truncated to retain all Hankel-
%    singular values greater than TOL. If TOL is omitted
%    then it is set to max(sig(1)*1.0E-12,1.0E-16).
% 
%    

function cos_tr
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = cos_tr(freq,mag,tinc,lastt)
% 
%    Generates a VARYING matrix containing a cosine signal:
%      FREQ  - frequency (radians/second)
%      MAG   - magnitude of cosine signal
%      TINC  - time increment
%      LASTT - final time (note the signal starts at time t=0)

function dtrsp
%MATLAB Tour Partial Function Help:  mu_con
%
% function y = dtrsp(sys,input,T,tfinal,x0,texthan)
% 
%   Time response of a discrete system:
% 	SYS:	packed form A,B,C,D system or constant.
% 	INPUT:	varying format input vector or constant.
% 	T:	sample time.
% 	TFINAL:	final time value
% 		(optional, default = input final time).
% 	X0:	initial state
% 		(optional, default = 0).
%        TEXTHAN: handle of uicontrol text object for update information.
%                 this is only used with SIMGUI.
% 
%    

function frsp
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = frsp(sys,omega,T,balflg)
% 
%    Complex frequency response of a SYSTEM matrix, produces
%    a VARYING matrix which contains its frequency response:
% 
%     SYS     - SYSTEM matrix
%     OMEGA   - response calculated at these frequencies, can
%                 also be another VARYING matrix, and then these
%                 independent variables are used
%     T       - 0 (default) continuous system, if T ~= 0 then
%          discrete evaluation with sample time T is used.
%     BALFLG  - 0 (default) balances A matrix prior to eval, nonzero
%                  value for BALFLG leaves state-space unchanged
%     OUT     - VARYING frequency response matrix
% 
%    

function sin_tr
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = sin_tr(freq,mag,tinc,lastt)
% 
%    Generates a VARYING matrix containing a sine signal:
%      FREQ  - frequency (radians/second)
%      MAG   - magnitude of sine signal
%      TINC  - time increment
%      LASTT - final time (note the signal starts at time t=0)
% 
%    

function sdtrsp
%MATLAB Tour Partial Function Help:  mu_con
%
% function [v,y,u] = sdtrsp(sys,K,input,h,tfinal,int,x0,z0,texthan)
% 
%   Calculates the time time response of a sampled data feedback
%   interconnection.  This is functionally equivalent to
% 
% 	v = starp(sys,K) * input,
% 
%   where SYS is the continuous time plant and K is the discrete
%   time controller.  Y is the input to the controller and U is
%   the controller output.  The other arguments are:
% 
%       SYS:	Continuous plant (SYSTEM or CONSTANT).
%       K:       Discrete time controller (SYSTEM or CONSTANT),
%       INPUT:	VARYING input vector or constant.
%       H:       Sample period of discrete controller.
%       TFINAL:	final time value
% 	          (optional, default = input final time).
%       INT:	integration step
% 		  (optional, default based on input & SYS. it
% 		   is recommended that the user specify this,
% 		   since the interval selected by SDTRSP is often
% 		   quite small, and can make the calculation
% 		   take a long time).  The program will force
% 		   int = h/n, with integer n, n >= 1.
%       X0:	initial state of continuous plant
% 	          (optional, default = 0).
%       Z0:	initial state of discrete controller.
% 	          (optional, default = 0).
%       TEXTHAN: handle of uicontrol text object for update information.
%                 this is only used with SIMGUI.
% 
%    If INT is specified as 0 SDTRSP works out a suitable
%    integration step. The output is generated at the selected
%    integration step size.  To reduce the number of output points
%    the user is referred to the function VDCMATE.
% 
%    

function siggen
%MATLAB Tour Partial Function Help:  mu_con
%
%  function y = siggen('function(t)',t)
% 
%    SIGGEN creates VARYING matrices as a function
%    of time.  If 'function()' is in terms of an argument,
%    that argument must be 't'.
% 
%    Examples:
% 
%        y = siggen('sin(t)',[0:pi/100:2*pi]);
%        y = siggen('rand(2,2)',[0:20]);
% 
%    

function simgui
%MATLAB Tour Partial Function Help:  mu_con
%
%  function simgui(toolhan,in1,in2,in3,in4,in5,in6,in7,in8,in9,in10,...
%                  in11,in12,in13,in14,in15)

function step_tr
%MATLAB Tour Partial Function Help:  mu_con
%
% function out = step_tr(timedata,stepdata,tinc,lastt)
% 
%   Creates a stairstep signal function of its INDEPENDENT
%   VARIABLE. The TIMEDATA vector indicates the "times" at
%   which the step changes occur, and the value of the
%   stairstep is given by the vector STEPDATA. The last two
%   variables, TINC and LASTT, correspond to the sample time
%   and length of the step signal.
% 
%      TINC  - time increment
%      LASTT - final time
% 
%   

function trsp
%MATLAB Tour Partial Function Help:  mu_con
%
% function y = trsp(sys,input,tfinal,int,x0,texthan)
% 
%   Calculates the time response of a SYSTEM matrix:
%       SYS:	SYSTEM or CONSTANT matrix.
%       INPUT:	VARYING input vector or constant.
%       TFINAL:	final time value
% 	          (optional, default = input final time).
%       INT:	integration step
% 		  (optional, default based on input & SYS. it
% 		   is recommended that the user specify this,
% 		   since the interval selected by TRSP is often
% 		   quite small, and can make the calculation
% 		   take a long time).
%       X0:	initial state
% 	          (optional, default = 0).
%  TEXTHAN:	handle of uicontrol text object for update information.
% 		this is only used with SIMGUI.
% 
%    If INT is specified as 0 TRSP works out a suitable
%    integration step. The output is generated at the selected
%    integration step size.  To reduce the number of output points
%    the user is referred to the function VDCMATE.
% 
%    

function dhfsyn
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [k,g,gfin,ax,ay,hamx,hamy] =
%          dhfsyn(p,nmeas,ncon,gmin,gmax,tol,h,z0,quiet,ricmethd,epr,epp)
% 
%   This function computes the H-infinity (sub) optimal n-state
%   controller, for a discrete time system, P, using a bilinear transformation
%   to continuous time and then calling HINFSYNE.
%   the system P is partitioned:
%                           | a   b1   b2   |
%               p    =      | c1  d11  d12  |
%                           | c2  d21  d22  |
%    where b2 has column size of the number of control inputs (NCON)
%    and c2 has row size of the number of measurements (NMEAS) being
%    provided to the controller.  Gives the extremal entropy solution
%    at the point z=z0.
% 
%    Inputs:
%       P        -   interconnection matrix for control design (discrete time)
%       NMEAS    -   # controller inputs (np2)
%       NCON     -   # controller outputs (nm2)
%       GMIN     -   lower bound on gamma
%       GMAX     -   upper bound on gamma
%       TOL      -   relative difference between final gamma values
%       H        -   sampling period (default=1)
%       Z0       -   point about which entropy is extremised (ABS(Z0)>1)
%                     (default Z0=inf)
%                     if ABS(Z0)>1 then all solutions are parametrized in K and G
%                     as starp(K,Phi) with norm of Phi < gfin.
%       QUIET    -   controls printing on screen:
%                      1 - no printing
%                      0 - header not printed
%                     -1 - full printing (default)
%       RICMETHD -   Riccati solution via
%                      1 - eigenvalue reduction (balance)
%                     -1 - eigenvalue reduction (no balancing)
%                      2 - real schur decomposition  (balance,default)
%                     -2 - real schur decomposition  (no balancing)
%       EPR      -   measure of when real(eig) of Hamiltonian is zero
%                     (default EPR = 1e-10)
%       EPP      -  positive definite determination of xinf solution
%                     (default EPP = 1e-6)
% 
%     Outputs:
%       K       -   H-infinity controller (discrete time)
%       G       -   closed-loop system    (discrete time)
%       GFIN    -   final gamma value used in control design
%       AX      -   X-Riccati solution as a VARYING matrix with
%                      independent variable gamma (optional)
%       AY      -   Y-Riccati solution as a VARYING matrix with
%                       independent variable gamma (optional)
%       HAMX    -   X-Hamiltonian matrix as a VARYING matrix with
%                       independent variable gamma (optional)
%       HAMY    -   Y-Hamiltonian matrix as a VARYING matrix with
%                       independent variable gamma (optional)
% 
%    

function dhfnorm
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = dhfnorm(sys,ttol,h,iiloc)
% 
%    Calculates the H_infinity norm of stable, discrete time SYSTEM
%    matrix, SYS, via a blinear tranformation and HINFNORM, or of VARYING
%    matrices, using PKVNORM. The second argument, TTOL, is used
%    for SYSTEM matrices, and is the relative tolerance
%    between the upper and lower bounds for the infinity
%    norm when the search is terminated. TTOL is optional with a
%    default value of 0.001. The optional third augment, H,
%    is the sample period (default = 1). The optional fourth
%    argument, IILOC, is for an initial frequency guess for
%    the worst case frequency, if desired.
% 
%    For SYSTEM matrices, OUT is a 1x3 row vector, with the
%    lower bound, upper bound, and the frequency where the lower
%    bound occurs. For CONSTANT matrices, OUT is a 1x3 row vector,
%    with the NORM of the matrix in the 1st two entries and 0 for
%    the frequency. OUT is the PKVNORM of SYS if SYS is a VARYING
%    matrix.
% 
%    

function emargin
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [erow1, erow] = emargin(system,controller,ttol)
% 
%  Calculates the normalized coprime factor/gap metric robust stability
%  margin, for a feedback loop with a given SYSTEM and CONTROLLER,
%  and a positive feedback convention.
% 
%  SYSTEM:     state-space system to be tested.
%  CONTROLLER: controller to be tested.
%  TTOL:       gives the required precision (default is 0.001).
% 
%  EROW1:      upper bound for the normalized coprime factor/gap metric
% 	        robust stability margin.
%  EROW:       a 1x3 row vetor, with the upper bound, lower bound and
%                and the frequency where the upper bound occurs.
% 
%  

function gap
%MATLAB Tour Partial Function Help:  mu_con
%
%   function delta=gap(sys1,sys2,ttol)
% 
%   Computes the gap metric between two systems SYS1 and SYS2.
% 
%   TTOL gives the tolerance to which the gap is calculated:
%   DELTA-TTOL < GAP =< DELTA.
%   The default for TTOL is 0.001.
% 
%   

function h2norm
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = h2norm(sys)
% 
%    Calculates the 2-norm of a stable, strictly
%    proper SYSTEM matrix. H2NORM solves a Lyapunov equation
%    with SYLV to get the controllability grammian.
% 
%    

function h2syn
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [k,g,norms,kfi,gfi,hamx,hamy] = ...
% 		h2syn(plant,nmeas,ncon,ricmethod,quiet)
% 
%    Calculate the H2 optimal controller (K) and the closed loop
%    system (G) for the linear fractional interconnection structure
%    P.  NMEAS and NCON are the dimensions of the measurement outputs
%    from P and the controller inputs to P. RICMETHOD determines the
%    method  used to solve the Riccati equations.
% 
%    inputs:
%      PLANT   -   system interconnection structure
%      NMEAS   -   measurements output to controller
%      NCON    -   control inputs
%      RICMETHOD -   Riccati solution via
%                     1 - eigenvalue reduction (balance)
%                    -1 - eigenvalue reduction (no balancing)
%                     2 - real schur decomposition  (balance,default)
%                    -2 - real schur decomposition  (no balancing)
%      QUIET   -   prints out minimum eigenvalues of X2 and Y2
% 		     0 - do not print results
% 		     1 - print results to command window (default)
% 
%    outputs:
%      K      -  H2 optimal controller
%      G      -  closed-loop system with H2 optimal controller
%      NORMS  -  norms of 4 different quantities, full information
%                control cost (FI), output estimation cost (OEF),
%                direct feedback cost (DFL) and full control cost (FC).
%                norms = [FI OEF DFL FC];
% 		h2norm(g) = sqrt(FI^2 + OEF^2) = sqrt(DFL^2 + FC^2)
%      KFI    -  full information/state feedback control law
%      GFI    -  full information/state feedback closed-loop system
%      HAMX   -  X Hamiltonian matrix
%      HAMY   -  Y Hamiltonian matrix
% 
%    

function hinffi
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [k,g,gfin,ax,hamx] = hinffi(p,ncon,gmin,gmax,tol,ricmethd,epr,epp)
% 
%   This function computes the FULL INFORMATION h-infinity n-state
%   controller, using Glover's and Doyle's 1988 result,
%   for a system P.  The solution assumes that all the states
%   and disturbances can be measured. The P matrix has the form:
% 
%        p  =  | ap  | b1   b2  |
%              | c1  | d11  d12 |
% 
%   Care must be taken by the user when closing the loop with the
%   full information controller. For feedback the interconnection
%   structure, P, must be augmented with state and disturbance
%   measurements.
% 
%   inputs:
%       P      -   interconnection matrix for control design
%       NCON   -   # controller outputs (nm2)
%       GMIN   -   lower bound on gamma
%       GMAX   -   upper bound on gamma
%       TOL    -   relative difference between final gamma values
%       RICMETHD - Ricatti solution via
%                      1 - eigenvalue reduction (balance)
%                     -1 - eigenvalue reduction (no balancing)
%                      2 - real schur decomposition  (balance,default)
%                     -2 - real schur decomposition  (no balancing)
%       EPR    -   measure of when real(eig) of Hamiltonian is zero
%                   (default EPR = 1e-10)
%       EPP    -   positive definite determination of xinf solution
%                   (default EPP = 1e-6)
% 
%   outputs:
%       K      -   H-infinity FULL INFORMATION controller
%       G      -   closed-loop system
%       GFIN   -   final gamma value used in control design
%       AX     -   Riccati solution as a VARYING matrix with independent
%                   variable gamma (optional)
%       HAMX   -   Hamiltonian matrix as a VARYING matrix with independent
%                   variable gamma (optional)

function hinfnorm
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = hinfnorm(sys,ttol,iiloc)
% 
%    Calculates the H_infinity norm of stable, SYSTEM
%    matrices, using the Hamiltonian method, or of VARYING
%    matrices, using PKVNORM. The second argument is used
%    for SYSTEM matrices, and is the relative tolerance
%    between the upper and lower bounds for the infinity
%    norm when the search is terminated. There is an optional
%    third argument, for a initial frequency guess, if desired.
%    for SYSTEM matrices, OUT is a 1x3 row vector, with the
%    lower bound, upper bound, and the frequency where the lower
%    bound occurs. The default value for TTOL is 0.001.
% 
%    

function hinfsyn
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [k,g,gfin,ax,ay,hamx,hamy] =
%                  hinfsyn(p,nmeas,ncon,gmin,gmax,tol,ricmethd,epr,epp,quiet)
% 
%   This function computes the H-infinity (sub) optimal n-state
%   controller, using Glover's and Doyle's 1988 result, for a system P.
%   the system P is partitioned:
%                           | a   b1   b2   |
%               p    =      | c1  d11  d12  |
%                           | c2  d21  d22  |
%    where b2 has column size of the number of control inputs (NCON)
%    and c2 has row size of the number of measurements (NMEAS) being
%    provided to the controller.
% 
%    inputs:
%       P        -   interconnection matrix for control design
%       NMEAS    -   # controller inputs (np2)
%       NCON     -   # controller outputs (nm2)
%       GMIN     -   lower bound on gamma
%       GMAX     -   upper bound on gamma
%       TOL      -   relative difference between final gamma values
%       RICMETHD -   Riccati solution via
%                      1 - eigenvalue reduction (balance)
%                     -1 - eigenvalue reduction (no balancing)
%                      2 - real schur decomposition  (balance,default)
%                     -2 - real schur decomposition  (no balancing)
%       EPR      -   measure of when real(eig) of Hamiltonian is zero
%                     (default EPR = 1e-10)
%       EPP      -  positive definite determination of xinf solution
%                     (default EPP = 1e-6)
%      QUIET   -   prints out information about H-infinity iteration
%                     0 - do not print results
%                     1 - print results to command window (default)
% 
%     outputs:
%       K       -   H-infinity controller
%       G       -   closed-loop system
%       GFIN    -   final gamma value used in control design
%       AX      -   X-Riccati solution as a VARYING matrix with
%                      independent variable gamma (optional)
%       AY      -   Y-Riccati solution as a VARYING matrix with
%                       independent variable gamma (optional)
%       HAMX    -   X-Hamiltonian matrix as a VARYING matrix with
%                       independent variable gamma (optional)
%       HAMY    -   Y-Hamiltonian matrix as a VARYING matrix with
%                       independent variable gamma (optional)
% 
%    

function hinfsyne
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [k,g,gfin,ax,ay,hamx,hamy] =
%                 hinfsyne(p,nmeas,ncon,gmin,gmax,tol,s0,quiet,ricmethd,epr,epp)
% 
%   This function computes the H-infinity (sub) optimal n-state
%   controller, using Glover and Doyle's 1988 result, for a system P.
%   the system P is partitioned:
%                           | a   b1   b2   |
%               p    =      | c1  d11  d12  |
%                           | c2  d21  d22  |
%    where b2 has column size of the number of control inputs (NCON)
%    and c2 has row size of the number of measurements (NMEAS) being
%    provided to the controller.  Gives the extremal entropy solution
%    at the point s=s0.
% 
%    inputs:
%       P        -   interconnection matrix for control design
%       NMEAS    -   # controller inputs (np2)
%       NCON     -   # controller outputs (nm2)
%       GMIN     -   lower bound on gamma
%       GMAX     -   upper bound on gamma
%       TOL      -   relative difference between final gamma values
%       S0       -   point about which entropy is extremised (>0)
%                     (default S0=inf)
%                     if S0<=0 then all solutions are parametrized in K and G
%                     as starp(K,Phi) with norm of Phi < gfin.
%       QUIET    -   controls printing on screen:
%                      1 - no printing
%                      0 - header not printed
%                     -1 - full printing (default)
%       RICMETHD -   Riccati solution via
%                      1 - eigenvalue reduction (balance)
%                     -1 - eigenvalue reduction (no balancing)
%                      2 - real schur decomposition  (balance,default)
%                     -2 - real schur decomposition  (no balancing)
%       EPR      -   measure of when real(eig) of Hamiltonian is zero
%                     (default EPR = 1e-10)
%       EPP      -  positive definite determination of xinf solution
%                     (default EPP = 1e-6)
% 
%     outputs:
%       K       -   H-infinity controller
%       G       -   closed-loop system
%       GFIN    -   final gamma value used in control design
%       AX      -   X-Riccati solution as a VARYING matrix with
%                      independent variable gamma (optional)
%       AY      -   Y-Riccati solution as a VARYING matrix with
%                       independent variable gamma (optional)
%       HAMX    -   X-Hamiltonian matrix as a VARYING matrix with
%                       independent variable gamma (optional)
%       HAMY    -   Y-Hamiltonian matrix as a VARYING matrix with
%                       independent variable gamma (optional)
% 
%    

function linfnorm
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = linfnorm(sys,ttol,iiloc)
% 
%    Calculates the L_infinity norm of stable or unstable SYSTEM
%    matrices, using the Hamiltonian method, or of VARYING
%    matrices, using PKVNORM. The second argument is used
%    for SYSTEM matrices, and is the relative tolerance
%    between the upper and lower bounds for the infinity
%    norm when the search is terminated. There is an optional
%    third argument, for a initial frequency guess, if desired.
%    for SYSTEM matrices, OUT is a 1x3 row vector, with the
%    lower bound, upper bound, and the frequency where the lower
%    bound occurs. The default value for TTOL is 0.001.
%    Identical to HINFNORM, except no stability check is made.
% 
%    

function ncfsyn
%MATLAB Tour Partial Function Help:  mu_con
%
%  function  [sysk,emax,sysobs]=ncfsyn(sysgw,factor,opt)
% 
%    Synthesizes a controller to robustly stabilize
%    a family of systems given by a ball of uncertainty
%    in the normalized coprime factors of the system description.
% 
%    Inputs:
%    -------
%     SYSGW  - the weighted system to be controlled.
%     FACTOR - =1 implies that an optimal controller is required.
%              >1 implies that a suboptimal controller is required
%                 achieving a performance FACTOR less than optimal.
%     OPT    - 'ref'  includes a reference input (optional).
% 
% 
%    Outputs:
%    -------
%     SYSK   -  H-infinity loopshaping controller
%     EMAX   -  stability margin as an indication robustness to
%               unstructured perturbations. EMAX is always less
%               than 1 and values of EMAX below 0.3 generally indicate
%               good robustness margins.
%     SYSOBS -  H-infinity loopshaping observer controller. This variable
%               is created only if FACTOR>1 and OPT = 'ref'
% 
%    

function nugap
%MATLAB Tour Partial Function Help:  mu_con
%
%   function gap = nugap(sys1,sys2,ttol)
% 
%   Computes Vinnicombe's variation of the gap metric
%   between the systems SYS1 and SYS2.
% 
%   TTOL gives the tolerance to which the gap is calculated.
%   The default is 0.001. This output GAP is Vinnicombe's
%   version of the gap metric.
% 
%   

function pkvnorm
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [pk,indepv,vindex] = pkvnorm(matin,p)
% 
%    Find peak value of the norm of a VARYING matrix, also
%    returns the value of the INDEPENDENT VARIABLE at the peak,
%    along with the index of the INDEPENDENT VARIABLE. The second
%    input argument determines the particular norm, using the same
%    convention as MATLAB's NORM command.
% 
%    

function sdhfsyn
%MATLAB Tour Partial Function Help:  mu_con
%
% function [k,gfin]=
% 	sdhfsyn(sdsys,nmeas,ncon,gmin,gmax,tol,h,delay,ricmethd,epr,epp,quiet)
% 
%   This function computes the H-infinity (sub) optimal n-state
%   discrete-time controller for a sampled-data system.  Using
%   results from Bamieh and Pearson '92, the initial problem is
%   converted isomorphically to discrete-time.  The discrete-time
%   problem is bilinearly mapped to continuous-time where Glover's
%   and Doyle's 1988 result is used.
% 
%   The continuous-time plant SDSYS is partitioned:
%                           | a   b1   b2   |
%               sdsys    =  | c1   0    0   |
%                           | c2   0    0   |
%    where b2 has column size of the number of control inputs (NCON)
%    and c2 has row size of the number of measurements (NMEAS) being
%    provided to the controller.  Note that d must be zero.
% 
%    Inputs:
%       SDSYS    -   interconnection matrix for control design
%                     (continuous time)
%       NMEAS    -   # controller inputs (np2)
%       NCON     -   # controller outputs (nm2)
%       GMIN     -   lower bound on gamma (MUST BE GREATER THAN 0)
%       GMAX     -   upper bound on gamma
%       TOL      -   relative difference between final gamma values
%       H        -   sampling period of the controller to be designed
%       DELAY    -   a non-negative integer giving the number of
%                    computational delays of the controller (default is 0)
%       RICMETHD -   Riccati solution via
%                      1 - eigenvalue reduction (balance)
%                     -1 - eigenvalue reduction (no balancing)
%                      2 - real schur decomposition  (balance,default)
%                     -2 - real schur decomposition  (no balancing)
%       EPR      -   measure of when real(eig) of Hamiltonian is zero
%                     (default EPR = 1e-10)
%       EPP      -   positive definite determination of xinf solution
%                     (default EPP = 1e-6)
%       QUIET    -   print out information on sampled-data H-infinity iteration
%                     0 - do not print results
%                     1 - print results to command window (default)
% 
% 
%     Outputs:
%       K       -   H-infinity controller (discrete time)
%       GFIN    -   final gamma value used in control design
% 
% 	                _________
% 	               |         |
% 	       <-------|  sdsys  |<--------
% 	               |         |
% 	      /--------|_________|<-----\
% 	      |       __  		 |
% 	      |      |d |		 |
% 	      |  __  |e |   ___    __    |
% 	      |_|S |_|l |__| K |__|H |___|
% 	        |__| |a |  |___|  |__|
% 	             |y |
% 	             |__|
% 
%    

function sdhfnorm
%MATLAB Tour Partial Function Help:  mu_con
%
% function [gaml,gamu]=sdhfnorm(sdsys,k,h,delay,tol);
% 
%   This function computes the L2 induced norm of a continuous-time
%   SYSTEM matrix in feedback with a discrete-time system matrix
%   connected through an ideal sampler and a zero-order hold.
% 
%   The continuous-time plant SDSYS is partitioned:
%                           | a   b1   b2   |
%               sdsys    =  | c1   0    0   |
%                           | c2   0    0   |
% 
%   Note that d must be zero.
% 
%    Inputs:
%       SDSYS    -   continuous-time SYSTEM matrix (plant)
%       K        -   discrete-time SYSTEM matrix   (controller)
%       H        -   sampling period of the controller K
%       DELAY    -   a non-negative integer giving the number of
%                    computational delays of the controller (default 0)
%       TOL      -   difference between upper and lower bounds
%                    when search terminates (default 0.001)
%     Outputs:
%       GAMU    -   upper bound on norm
%       GAML    -   lower bound on norm
% 
% 
% 	                _________
% 	               |         |
% 	     z <-------|  sdsys  |<-------- w
% 	               |         |
% 	      /--------|_________|<-----\
% 	      |       __  		 |
% 	      |      |d |		 |
% 	      |  __  |e |   ___    __    |
% 	      |_|S |_|l |__| K |__|H |___|
% 	        |__| |a |  |___|  |__|
% 	             |y |
% 	             |__|
% 
%    

function blknorm
%MATLAB Tour Partial Function Help:  mu_con
%
% function out = blknorm(mat,blk)
% 
%    Takes block by block norms of the input matrix MAT.
%    BLK represents the block structure associated with MAT.
%    Note that all blocks are treated as full block
%    regardless of their block structure.
% 
%    

function cmmusyn
%MATLAB Tour Partial Function Help:  mu_con
%
% function [qopt,bound] = cmmusyn(r,u,v,blk,opt,Qinit)
% 
%    Constant-Matrix Upper-Bound mu-Synthesis.  Minimizes
%        (over constant matrix Q) the upper bound of
%        mu(R+UQV), using the block structure defined
%        by BLK.

function dkit
%MATLAB Tour Partial Function Help:  mu_con
%
%  DKIT
% 
%  This file implements mu-synthesis iteration by D-K iteration.
%  A number of variables associated with the particular problem
%  need to be specified by the user.  See Manual.

function dkitgui
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = dkitgui(toolhan,in,in2,in3,in4,in5,in6,in7);

function dypert
%MATLAB Tour Partial Function Help:  mu_con
%
% function rat_pert = dypert(pvec,blk,bnds,blks)
% 
% 	Creates rational, stable perturbation which
% 	interpolates the frequency varying perturbation, PVEC,
% 	at the peak value of the lower bound in BNDS (frequency
% 	where the perturbation is the smallest).  PVEC is
% 	perturbation vector generated from MU, BLK is the
% 	block structure, BNDS is the upper and lower bounds
% 	generated from MU, BLKS is the optional numbers of
% 	the blocks which are to be included in the rational
% 	perturbation output.
% 
% 	

function fitmag
%MATLAB Tour Partial Function Help:  mu_con
%
% function [sys,dmdi] = fitmag(magdata,wt,heading,osysl_g,dmdi,upbd,blk,blknum)
% 
%    FITMAG fits a stable, minimum phase transfer function
%    to magnitude data, MAGDATA, with a supplied frequency
%    domain weighting function, WT. Both these should
%    be VARYING matrices, with identical INDEPENDENT
%    VARIABLE values. FITMAG uses GENPHASE to generate
%    phase data, and FITSYS to do the fit.
% 
%    HEADING (optional) is the title displayed and OSYSL_G
%    (optional) is the FRSP of the old fit.  If given, it will be
%    displayed along with the data.
% 
%    The (optional) variable DMDI is the matrix that produced the
%    MAGDATA, WT and UPBD data. Upon fitting the D, the stable,
%    minimum phase system matrix SYS, is absorbed into the original
%    matrix DMDI and plotted along with the UPBD data. BLK is the
%    block structure using in the MU command and BLKNUM defines
%    the current D scaling to be fit.
% 
%    A comparison of these two plots provides insight into how
%    well the rational system matrix SYS fits the D data. The newly
%    scaled matrix DMDI, which is CLPG with SYS wrapped is then
%    return. If DMDI, UPBD, BLK and BLKNUM are not provided, the
%    default is to plot the WT variable instead. These options are
%    used with MUSYNFIT.
% 
%    

function fitmaglp
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [sys] = fitmaglp(magdata,wt,heading,osysl_g,...
%                                 dmdi,upbd,blk,blknum)
% 
%   FITMAGLP fits a stable, minimum phase transfer function
%    to magnitude data, MAGDATA, with a supplied frequency
%    domain weighting function, WT. Both these should
%    be VARYING matrices, with identical INDEPENDENT
%    VARIABLE values.
% 
%    HEADING (optional) is the title displayed and OSYSL_G
%    (optional) is the FRSP of the old fit.  If given, it will be
%    displayed along with the data.
% 
%    The (optional) variable DMDI is the matrix that produced the
%    MAGDATA, WT and UPBD data. Upon fitting the D, the stable,
%    minimum phase system matrix SYS, is absorbed into the original
%    matrix DMDI and plotted along with the UPBD data. BLK is the
%    block structure using in the MU command and BLKNUM defines
%    the current D scaling to be fit.
% 
%    A comparison of these two plots provides insight into how
%    well the rational system matrix SYS fits the D data. The newly
%    scaled matrix DMDI, which is CLPG with SYS wrapped is then
%    return. If DMDI, UPBD, BLK and BLKNUM are not provided, the
%    default is to plot the WT variable instead. These options are
%    used with MUSYNFIT.
% 
%    Identical to FITMAG except that MAGFIT is used instead
%    of GENPHASE and FITSYS.
% 
%    

function genmu
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [bnd,q,dd,gg] = genmu(m,c,blk)
% 
%    Generalized-mu Upper bound Calculation
% 
%    [I - Delta M;C] is guaranteed not to lose
%    column rank for all perturbations Delta
%    in BLK, with norm < 1/BND.  This is guaranteed
%    by a matrix Q, such that mu(M+QC)<=BND, as
%    verified with the scalings in DD and GG.
% 
%    See MU, CMMUSYN

function genphase
%MATLAB Tour Partial Function Help:  mu_con
%
%  function resp = genphase(d,discflg)
% 
%    Uses the complex-cepstrum (Oppenheim & Schafer, Digital
%    Signal Processing, pg 501) to generate a complex
%    frequency response, RESP, whose magnitude is equal to
%    the real, positive response D, but whose phase corresponds
%    to a stable, minimum phase function. Both D and RESP are
%    VARYING matrices.
% 
%    If DISCFLG==1 (default=0) then all frequency data is
%    interpreted as unit disk data, and RESP should be interpreted
%    as discrete-time.  If DISCFLG==0, then the frequency data is
%    interpreted as imaginary axis, and RESP is interpreted as
%    continuous time.
% 
%    

function magfit
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [sys,fit,extracons] = magfit(vmagdata,dim,wt)
% 
%   MAGFIT fits a stable, minimum phase transfer function
%   to magnitude data, VMAGDATA, with a supplied frequency
%   domain weighting function, WT. VMAGDATA is a VARYING
%   matrix giving the magnitude and frequency points to be
%   matched,
% 
%      [mag,rowpoint,omega,err] = vunpck(vmagdata).
% 
%   DIM is a 1 by 4 vector with dim= [hmax,htol,nmin,nmax].
%   The output system, SYS, is a stable minimum phase SISO
%   system that satisfies:
% 
%              1/(1+ h/W) < g^2/mag^2 < 1+ h/W
% 
%   where g is the magnitude of the frequency response of SYS
%   for frequencies omega, [W,rowpoint,omega,err] = vunpck(WT).
%   The degree of SYS is N, where 0<=NMIN<=N<=NMAX is the minimum
%   degree to meet the specificaton with H<=HMAX. If no such n
%   exists then N=NMAX. The value of H is approximately minimized
%   between upper and lower bounds terminating when
%   hupper-hlower<=HTOL. FIT is the achieved value of H.
% 
%  

function msf
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [dsysl,dsysr] = msf(clpg,bnds,dvec,sens,blk,diagnos,dflag)

function msfbatch
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [dsysl,dsysr] = ...
%     msfbatch(clpg,bnds,dvec,sens,blk,maxord,visflag,dflag)

function mu
%MATLAB Tour Partial Function Help:  mu_con
%
% function [bnds,rowd,sens,rowp,rowg] = mu(matin,blk,opt)
% 
%    Calculates mixed (real and complex) structured
%    singular value (mu) of a CONSTANT/VARYING matrix.
% 
%    Inputs: MATIN - input matrix, CONSTANT/VARYING
%        BLK   - block structure
%        OPT   - optional argument, character string
%            containing any of the following (DEFAULT = 'lu'):
%          'l' lower bound, power iteration
%          't' increase iterations in lower bound
%          'R' start lower bound with RANDOM vectors
%          'R7' restart lower bound 7 times with RANDOM vectors (use 1-9),
%                larger number typically gives better lower bound, but involves
%                additional (and hence slower) computation
%          'u' upper bound, balanced/LMI technique
%          'c' upper bound to greater accuracy
%          'C' upper bound to even greater accuracy
%          'C1' same as 'C'
%          'C9' upper bound to greatest accuracy (use any number 1-9, larger
%               number gives better bound, but slower computation)
%          'f' fast but crude upper bound
%          'r' restart computation at EACH independent variable
%          's' suppress progress information
%          'w' suppress warnings
%          'L' only compute lower bound
%          'U' only comute upper bound
% 
%    Outputs:    BNDS  - upper and lower bounds
%        SENS  - sensitivity of || D M D^{-1} || to D scaling
%        ROWP  - perturbation from lower bound
%        ROWD  - D scaling from upper bound
%        ROWG  - G scaling from upper bound
%            ROWD, SENS, ROWP, ROWG are in compressed form
% 
%    

function muftbtch
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [dsysl,dsysr] =
%       muftbtch(pre_dsysl,Ddata,sens,blk,nmeas,ncntrl,dim,wt)
% 
%    Fit the magnitude curve obtained by multiplying the old D
%    frequency response (from PRE_DSYSL) with the DDATA data.
%    Returns stable, minimum phase system matrices DSYSL and
%    DSYSR, which can be absorbed into the original interconnection
%    structure with multiplications (using MMULT), and one inverse
%    (using MINV). Once absorbed, a H_infinity design can then be
%    performed, completing another iteration of MU-SYNTHESIS.
% 
%    For the first MU-SYNTHESIS iteration, the variable
%    PRE_DSYSL should be set to the string  'first'.  In subsequent
%    iterations, PRE_DSYSL should be the previous (left) rational
%    D-scaling system matrix, DSYSL.
% 
%    For MAGFIT the specification of dim=[hmax,htol,nmin,nmax]
%    (suggest dim=[.26,.1,0,3] to get a 3rd order fit of accuracy
%    of 1dB if possible.)
% 
%    

function musynfit
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [dsysl,dsysr] = musynfit(pre_dsysl,Ddata,sens,blk,nmeas,...
%                                     ncntrl,clpg,upbd,wt)
% 
%    Fits the magnitude curve obtained by multiplying the old D
%    frequency response (from PRE_DSYSL) with the DDATA data.
%    Returns stable, minimum phase system matrices DSYSL and
%    DSYSR, which can be absorbed into the original interconnection
%    structure with multiplications (using MMULT), and one inverse
%    (using MINV). Once absorbed, a H_infinity design can be
%    performed, completing another iteration of MU-SYNTHESIS.
% 
%    For the first MU-SYNTHESIS iteration, the variable
%    PRE_DSYSL should be set to the string  'first'
%    In subsequent iterations, PRE_DSYSL should be the previous
%    (left) rational D-scaling system matrix, DSYSL.
% 
%    The (optional) variable CLPG is the matrix that produced the DDATA, SENS
%    and UPBD data. Upon fitting the DDATA, the stable, minimum phase
%    system matrices DSYSL and DSYSR, are absorbed into the original
%    matrix CLPG and plotted along with the UPBD data. A comparison of
%    these two plots provides insight into how well the rational system
%    matrices DSYSL and DSYSR fit the DDATA. The newly scaled matrix DMDI,
%    which is CLPG with DSYSL and DSYSR wrapped is then return. If CLPG
%    and UPBD are not provided, the default is to plot the SENS
%    variable instead.
% 
%    The optional WT variable allows you to weight the DDATA, the default
%    is no additional weighting on the DDATA.
% 
%    

function musynflp
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [dsysl,dsysr] = musynfit(pre_dsysl,Ddata,sens,blk,nmeas,...
%                                     ncntrl,clpg,upbd,wt)
% 
%    Fits the magnitude curve obtained by multiplying the old D
%    frequency response (from PRE_DSYSL) with the DDATA data.
%    Returns stable, minimum phase system matrices DSYSL and
%    DSYSR, which can be absorbed into the original interconnection
%    structure with multiplications (using MMULT), and one inverse
%    (using MINV). Once absorbed, a H_infinity design can be
%    performed, completing another iteration of MU-SYNTHESIS.
% 
%    For the first MU-SYNTHESIS iteration, the variable
%    PRE_DSYSL should be set to the string  'first'
%    In subsequent iterations, PRE_DSYSL should be the previous
%    (left) rational D-scaling system matrix, DSYSL.
% 
%    The (optional) variable CLPG is the matrix that produced the DDATA, SENS
%    and UPBD data. Upon fitting the DDATA, the stable, minimum phase
%    system matrices DSYSL and DSYSR, are absorbed into the original
%    matrix CLPG and plotted along with the UPBD data. A comparison of
%    these two plots provides insight into how well the rational system
%    matrices DSYSL and DSYSR fit the DDATA. The newly scaled matrix DMDI,
%    which is CLPG with DSYSL and DSYSR wrapped is then return. If CLPG
%    and UPBD are not provided, the default is to plot the SENS
%    variable instead.
% 
%    The optional WT variable allows you to weight the DDATA, the default
%    is no additional weighting on the DDATA.
% 
%    Identical to MUSYNFIT except that FITMAGLP is called instead of
%    FITMAG, and this calls MAGFIT.
% 
%    

function muunwrap
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [dl,dr,gl,gm,gr,prt] = muunwrap(in1,in2,in3,in4)
% 
% 	             [dl,dr] = muunwrap(rowd,blk)       OR
% 	    [dl,dr,gl,gm,gr] = muunwrap(rowd,rowg,blk)  OR
% 	[dl,dr,gl,gm,gr,prt] = muunwrap(rowd,rowg,rowp,blk)
% 
% 	Unwraps rowd, rowg and rowp from an rmu calculation
% 	into block diagonal form.
% 
% 	

function randel
%MATLAB Tour Partial Function Help:  mu_con
%
% function pert = randel(blk,nrm,opt)
% 
%   Generates a random, block structured perturbation
%   with specified norm (i.e. max singular value). The
%   block structure is specified by the argument BLK,
%   and the norm is specified by the argument NRM.
% 
%   The complex blocks have norm = NRM, and the real
%   blocks have norm specified as: (default is 'i')
% 
%   If opt = 'i' the real blocks have norm <=  NRM
%   If opt = 'b' the real blocks have norm  =  NRM
% 
%   

function sisorat
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = sisorat(freq,gain)
%     or
%  function out = sisorat(data_g)
% 
%    Finds a first order, stable transfer function that has a
%    gain of GAIN at a frequency FREQ. In the case of one
%    input argument, DATA_G must be a 1x1 VARYING matrix, with
%    1 data point. The INDEPENDENT VARIABLE is interpreted as
%    FREQ, and the value of the matrix is interpreted as GAIN.
%    The transfer function produced has constant magnitude
%    across frequencies.
% 
%    

function unwrapd
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [dleft,dright] = unwrapd(dvec,blk)
% 
%    Unwraps the D scaling matrices in DVEC (from an
%    upper bound MU calculation) into the block diagonal form.
% 
%    

function unwrapp
%MATLAB Tour Partial Function Help:  mu_con
%
% function prt = unwrapp(rowp,blk)
% 
% 	Unwraps ROWP from a MU calculation
% 	into block diagonal form
% 
% 	

function wcperf
%MATLAB Tour Partial Function Help:  mu_con
%
% function [delta,lowerbnd,upperbnd] = wcperf(Mg,blk,pertsizew,npts)
% 
%    Calculates worst-case performance for an upper-loop
%        Linear Fractional Transformation.
%        
%    Inputs: MG        - input matrix, CONSTANT/VARYING
%            BLK       - block structure
%            PERTSIZEW - size of the perturbation
% 	    NPTS      - number of perturbation points (default is 1)
% 
%   Outputs: DELTA     - worst-case perturbation
%            LOWERBND  - lower bound on the perturbation(s) 
%            UPPERBND  - upper bound on the perturbation(s) 
% 
%    

function getiv
%MATLAB Tour Partial Function Help:  mu_con
%
% function [indv,err] = getiv(mat,iv_index)
% 
%    Returns the INDEPENDENT VARIABLE values of the
%    VARYING matrix MAT. The INDEPENDENT VARIABLE is
%    returned as a column vector, and ERR = 0. If MAT
%    is not a VARYING matrix, then INDV is empty,
%    and ERR = 1.  With two arguments, it returns only
%    the independent variables associated with the
%    positive integer vector of indices, IV_INDEX.
% 
%    

function indvcmp
%MATLAB Tour Partial Function Help:  mu_con
%
%  function code = indvcmp(mat1,mat2,errcrit)
% 
%    Compares the INDEPENDENT VARIABLE data for two VARYING matrices:
%        CODE = 0; varying data is different
%        CODE = 1; varying data is identical OR both are CONSTANT matrices
%        CODE = 2; different number of points
%        CODE = 3; matrices are not both VARYING, or not both CONSTANT
% 
%        ERRCRIT - 1x2 optional matrix containing the relative
%           error and absolute error bounds. The relative error
%           is used to test error in independent variables whose
%           magnitude is greater than 1e-9, while the absolute
%           error bound used for smaller independent variable
%           values. Default values are 1e-6, and 1e-13, respectively.
% 
%    

function massign
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = massign(matin,rowindex,colindex,data)
% 
% 	out = massign(matin,rowindex,colindex,data)
% 
% 	Performs a matrix assignment like operation on VARYING
% 	and SYSTEM matrices.  It is functionally equivalent
% 	to:
% 		matin(rowindex,colindex) = data,
% 
% 	where rowindex and colindex are vectors specifying the
% 	rows and columns (or outputs and inputs if matin is
% 	a SYSTEM) to be changed.
% 
% 	data must either be a constant or of the same type
% 	as matin.  The dimension of data must be consistent
% 	with the length of rowindex and colindex.
% 
% 	Warning:  when applied to a SYSTEM, the result will
% 	almost always be non-minimal.
% 
% 	

function scliv
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [vout] = scliv(vin,fac,offset)
% 
%    Scale the independent variable elements of a varying matrix by FAC
%    and adds the OFFSET (optional) to each. i.e.
% 
% 	newiv = fac*oldiv + offset.
% 
%    This does nothing for a CONSTANT matrix and returns an error
%    for a SYSTEM matrix.
% 
%    

function sortiv
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [out,err] = sortiv(in,sortflg,nored,epp)
% 
%    If the INDEPENDENT VARIABLE is not monotonically increasing,
%    then the INDEPENDENT VARIABLE is reordered accordingly and
%    return to OUT. SORTFLG = 0 (default) sorts the INDEPENDENT
%    VARIABLE in increasing order and SORTFLG = 1 sorts in
%    decreasing order. NORED = 0 (default) does not
%    reduce the number of INDEPENDENT VARIABLEs even if there
%    are repeated ones. Setting NORED to a nonzero value causes
%    repeated INDEPENDENT VARIABLEs to be collapsed down if
%    their corresponding matrices are the same, if they are
%    not an error message is displayed and only the first
%    INDEPENDENT VARIABLE and corresponding matrix is kept.
%    The output argument ERR which is nominally 0, is set to 1
%    if an error message is displayed. EPP is used to test for
%    closeness of two INDEPENDENT VARIABLEs and the matrices
%    associated them. Its default values is [1e-9; 1e-9]. SORTIV
%    can be used with TACKON to mesh together frequency responses
%    or time responses.
% 
%    

function tackon
%MATLAB Tour Partial Function Help:  mu_con
%
%  function matout = tackon(mat1,mat2)
% 
%    Concatenates two VARYING matrices, which must be
%    of the same row and column dimension.
% 
%    

function var2con
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [matout,ivval] = var2con(mat,desiv)
% 
%    VARYING to CONSTANT matrix conversion. If there is
%    one input argument, MAT, and it is a VARYING matrix, then
%    the output MATOUT is the CONSTANT matrix in MAT associated
%    with the INDEPENDENT VARIABLE's first value. The optional
%    second output argument is this INDEPENDENT VARIABLE's value.
%    If two input arguments are used, then it is assumed that
%    the first is a VARYING matrix, and the second is a
%    desired INDEPENDENT VARIABLE's value. The command
%    finds the matrix in MAT whose INDEPENDENT VARIABLE's
%    value is closest to DESIV, and returns this matrix
%    as a CONSTANT matrix.
% 
%    

function varyrand
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = varyrand(rdim,cdim,nindv,ivflg)
% 
%   Create a random VARYING matrix, with a specified number of
%   rows RDIM, columns CDIM, and independent variable values NINDV.
%   The default value for IVFLG is 0 which sorts the positive,
%   random independent variables to be monotonically increasing.
%   If IVFLG is set to a nonzero value, then the independent variable's
%   values are 1:NINDV.
% 
%    

function vpck
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vpck(mat,indv)
% 
%    Pack a VARYING matrix from stacked matrix
%    and independent variable data.
% 
%    

function vunpck
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [data,rowpoint,indv,err] = vunpck(mat)
% 
%    Unpacks a VARYING matrix. The values of MAT are
%    placed in the variable DATA, stacked one on top of
%    another. The value of ROWPOINT(i) points to the
%    row of DATA which corresponds to the first row of
%    the i'th value of MAT. INDV is a column vector with
%    the INDEPENDENT VARIABLE values. ERR normally is 0,
%    but equals 1 if mat is a SYSTEM matrix.
% 
%    

function xtract
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [matout,err] = xtract(mat,ivlow,ivhigh)
%    or
%  function [matout,err] = xtract(mat,desiv)
% 
%    3 INPUT ARGUMENTS:
%    ==================
%    Extract specified portion of a VARYING matrix, with
%    INDEPENDENT VARIABLE's values between IVLOW and IVHIGH.
%    XTRACT assumes that the INDEPENDENT VARIABLE value's are
%    sorted in ascending order.  Use SORTIV if necessary.
% 
%    2 INPUT ARGUMENTS:
%    ==================
%    A VARYING matrix whose INDEPENDENT VARIABLE's value's
%    are closest (in absolute value) to the values of the
%    second input argument is extracted as a VARYING matrix
%    (with as many points as there are elements in the
%    second argument).
% 
%    

function xtracti
%MATLAB Tour Partial Function Help:  mu_con
%
%  function matout = xtracti(mat,ivindex,ascon)
% 
%    If MAT is a VARYING matrix, and IVINDEX is a
%    positive integer array, with
% 
%                MAX(IVINDEX) <= LENGTH(GETIV(MAT))
% 
%    then MATOUT is the matrix associated with
%    the IVINDEX'th INDEPENDENT VARIABLE's values.
%    MATOUT is, by default, a VARYING matrix.  If
%    the optional 3rd argument, ASCON, is set to
%    a positive number, then MATOUT is a constant
%    matrix containing the extracted data.
% 
%    If MAT is a CONSTANT or SYSTEM matrix, and
%    INDVINDX is a positive integer, then MATOUT
%    is equal to MAT.
% 
%    

function vabs
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vabs(mat)
% 
%    Element-by-element absolute value of a
%    VARYING/CONSTANT matrix.
% 
%    

function vceil
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vceil(mat)
% 
%    Rounds the elements of a VARYING/CONSTANT matrix MAT
%    to the nearest integer towards infinity. Identical
%    to MATLAB's CEIL command, but works with VARYING
%    matrices also.
% 
%    

function vdet
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vdet(mat)
% 
%    Determinant of a VARYING/CONSTANT matrix, identical
%    to MATLAB's DET command, but works with
%    VARYING matrices also.
% 
%    

function vdiag
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vdiag(matin)
% 
%    Diagonal of a VARYING matrix. Operates just as DIAG
%    does in standard MATLAB, but on VARYING matrices also.
% 
%    

function veig
%MATLAB Tour Partial Function Help:  mu_con
%
%  function  eval = veig(mat1,mat2)
%    or
%  function  [evect,eval] = veig(mat1,mat2)
% 
%    Eigenvalue decomposition of a VARYING matrix.
%      inputs:
%             mat1  - square matrix, CONSTANT/VARYING
%             mat2  - square matrix, CONSTANT/VARYING (optional)
%      outputs:
% 	     eval  - vector containing eigenvalues of MAT1,
%                      CONSTANT/VARYING
% 	     evect - full matrix containing eigenvectors of MAT1,
%                      CONSTANT/VARYING
% 
%    If MAT2 is supplied, a generalized eigenvalue problem is solved.
% 
%    

function vexpm
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vexpm(mat)
% 
%    Matrix exponential of a VARYING/CONSTANT matrix.
%    Identical to MATLAB's EXPM command, but works
%    with VARYING matrices also.
% 
%    

function vfft
%MATLAB Tour Partial Function Help:  mu_con
%
%  function yout = vfft(yin,n)
% 
%   Perform an N length FFT on the VARYING matrix YIN.  N is optional,
%   defaulting to the number of INDEPENDENT VARIABLEs in YIN.  If N is
%   greater than the number of INDEPENDENT VARIABLEs in YIN, the data
%   is zero padded.  If N is less the data is truncated.  The MATLAB
%   function FFT is used for the actual calculation.
% 
%   It is assumed that the YIN is a time scale in seconds and YOUT is
%   returned with a frequency scale in radians/sec.  The time scale
%   is assumed to be monotonic and only the first interval is used
%   to determine the frequency scale.
% 
%    

function vfloor
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vfloor(mat)
% 
%    Rounds the elements of a VARYING/CONSTANT matrix MAT
%    to the nearest integer towards minus infinity. Identical
%    to MATLAB's FLOOR command, but works with VARYING
%    matrices also.
% 
%    

function vifft
%MATLAB Tour Partial Function Help:  mu_con
%
%  function yout = vifft(yin)
% 
%   Perform an inverse FFT on the VARYING matrix Y.  It is assumed
%   that the YIN is a frequency scale in rad/sec and YOUT is returned
%   with a time scale in seconds.  The frequency scale is assumed to
%   be monotonic and only the first interval is used to determine
%   the time scale.
% 
%   

function vinv
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vinv(mat)
% 
%    Invert a VARYING/CONSTANT matrix. Identical to
%    the MATLAB command INV and works on VARYING matrices.
% 
%    

function vimag
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vimag(mat)
% 
%    Imaginary part of VARYING/CONSTANT matrix. Identical
%    to MATLAB's IMAG command, but VIMAG works on VARYING
%    matrices also.
% 
%    

function vnorm
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vnorm(matin,p)
% 
%    Norm of a VARYING matrix. VNORM operates just as NORM
%    does in standard MATLAB, but on VARYING matrices also.
%    The option P denotes the norm desired. The default is the
%    infinity norm of MATIN just as with NORM.
% 
%    

function vpoly
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vpoly(mat)
% 
%    Characteristic polynomial of a VARYING/CONSTANT
%    matrix. Identical to MATLAB's POLY command, but
%    works with VARYING matrices also.
% 
%    

function vpinv
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vpinv(mat,tol)
% 
%    Pseudo-inverse of a VARYING/CONSTANT matrix.
%    Identical to MATLAB's PINV command. The default
%    value for TOL is 1e-12.
% 
%    

function vrank
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vrank(mat)
% 
%    Rank of a VARYING/CONSTANT matrix.
%    Identical to MATLAB's RANK command, but works
%    with VARYING matrices also.
% 
%    

function vrcond
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vrcond(mat)
% 
%    Estimate of condition number of a VARYING/CONSTANT
%    matrix. Identical to MATLAB's RCOND command, but
%    works with VARYING matrices also.
% 
%    

function vreal
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vreal(mat)
% 
%    Real part of VARYING/CONSTANT matrix, identical
%    to MATLAB's REAL command, but VREAL works on
%    VARYING matrices also.
% 
%    

function vroots
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vroots(mat)
% 
%    If MAT is a VARYING matrix, with either
%    1 row or 1 column, then OUT is a VARYING matrix
%    of the roots of the polynomial represented
%    by the vector. VROOTS works with identically to
%    the MATLAB function ROOTS, however it works
%    with VARYING matrices also.
% 
%    

function vschur
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [u,t] = vschur(mat)
% 
%    Schur decomposition of a VARYING/CONSTANT matrix,
%    identical to MATLAB's SCHUR command, but VSCHUR
%    works with VARYING matrices also.
%      input:
% 	     MAT - VARYING/CONSTANT matrix
%      outputs:
% 	     U   - unitary matrix, VARYING/CONSTANT matrix
%                    MAT = MMULT(U,T,TRANSP(U)), and  MMULT(TRANSP(U),U)
% 		    is the identity of the corresponding type.
%             T   - complex or real schur Schur form depending on the
% 		    input, VARYING/CONSTANT matrix.
% 
%    

function vspect
%MATLAB Tour Partial Function Help:  mu_con
%
%  function P = vspect(x,y,m,noverlap,window)
% 
%    Spectral analysis routine modeled after SPECTRUM in the
%    Signal Processing Toolbox.  X (and optionally Y) are VARYING
%    matrices representing time domain sequences.  M point ffts are
%    used with NOVERLAP points of overlap.  WINDOW is an optional
%    string specifying a window (default is 'hanning'). Currently
%    supported options within the Signal Processing toolbox are:
%    'hanning', 'hamming', 'boxcar','blackman','bartlett', and 'triang'.
% 
%    The returned VARYING matrix, P, has the following columns
%    [Pxx Pyy Pxy Txy Cxy].  Pxx (Pyy) is the power spectrum of X (Y),
%    Pxy is the cross spectrum, Txy is the transfer function, and
%    Cxy is the coherence.  For a single input sequence only Pxx is
%    returned.  The returned independent variable is frequency in
%    radians/seconds. The signal Y (or X in the single signal case)
%    can be a vector of signals.  The transfer function is calculated
%    for each output. This corresponds to single-input/multi-output
%    transfer function estimation.  Each row of P corresponds to the
%    appropriate row of Y.
% 
%    

function vsqrtm
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vsqrtm(mat)
% 
%    Matrix square root of a VARYING/CONSTANT matrix. Identical to
%    the MATLAB command SQRTM and works on VARYING matrices.
% 
%    

function vsvd
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [u,s,v] = vsvd(mat)
% 
%    Singular value decomposition of a VARYING/CONSTANT
%    matrix, identical to MATLAB's SVD command, but
%    VSVD works with VARYING matrices also.
% 
%    

function vcjt
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vcjt(mat)
% 
%    Complex conjugate transpose for CONSTANT/VARYING matrices;
% 
%    

function vcond
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vcond(mat)
% 
%    Condition number of a VARYING/CONSTANT matrix,
%    identical to MATLAB's COND command, but works
%    with VARYING matrices also.
% 
%    

function vconj
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vconj(mat)
% 
%    Complex conjugate for VARYING/CONSTANT matrices, a
%    VARYING matrix version of MATLAB CONJ function.
% 
%    

function vdcmate
%MATLAB Tour Partial Function Help:  mu_con
%
%  function vout = vdcmate(vin,spacing)
% 
%    The input VARYING matrix is decimated; i.e the output only
%    contains the input at the points specified by spacing.  If no
%    spacing argument is provided, the default is 10, in honour of
%    the original Roman punishment.
% 
%    

function vebe
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vebe(oper,mat)
% 
%    Element-by-element operation on a VARYING/CONSTANT matrix,
%    using standard MATLAB arithmetic functions with one input
%    argument, such as SIN, ABS, REAL, SQRT, LOG, GAMMA, etc.
%    OPER needs to be a character string, i.e. 'sin', 'abs', etc.
% 
%    

function veberec
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = veberec(matin)
% 
%   element-by-element reciprical for
%   VARYING matrices

function veval
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [out1,out2,out3,...] = veval(name,in1,in2,in3,...)
% 
%    Works like MATLAB FEVAL, but on collections of VARYING and
%    CONSTANT/SYSTEM matrices. NAME is a character string with
%    the name of a MATLAB function (user written, or MATLAB
%    supplied).  The function is applied to each input argument
%    at the INDEPENDENT VARIABLE's values. Any CONSTANT/SYSTEM
%    matrices are held at their value while the sweep through
%    INDEPENDENT VARIABLE is done. Currently limited to 10
%    output arguments, and an unlucky 13 input arguments, which
%    is easily changable.
% 
%    VEVAL can be used to easily generate VARYING system matrices.
% 
%    

function vveval
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [out1,out2,out3,...] = vveval(name,in1,in2,in3,...)
% 
%    Works like MATLAB FEVAL, but on collections of VARYING and
%    CONSTANT/SYSTEM matrices. NAME is a character string with
%    the name of a MATLAB function (user written, or MATLAB
%    supplied).
% 
% 	If in1, in2, ... in_last are all either CONSTANT or
% 	SYSTEM matrices, then VVEVAL calls the function specified
% 	by the variable NAME, using FEVAL.
% 
%    If any of in1, in2, ... in_n are VARYING, say in_K, then VVEVAL
%    checks that all of the VARYING data is the same, and performs
%    a loop, recursively calling itself in the following manner
% 
% 
%    out1 = [];
% 	  .
%    outm = [];
%    for i=1:length(getiv(in_K))
%      [t1,t2,..,tm] = vveval(xtracti(in1,i),xtracti(in2,i),.,xtracti(in_n,i);
%      out1 = [out1;t1];
%      out2 = [out2;t2];
%      outm = [outm;tm];
%    end
%    out1 = vpck(out1,ivvalue);
%    out2 = vpck(out2,ivvalue);
%    outm = vpck(outm,ivvalue);
% 
%    

function mveval
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [out1,out2,out3,...] = mveval(name,mask,in1,in2,in3,...)
% 
%    Works like MATLAB FEVAL, but on collections of VARYING and
%    CONSTANT/SYSTEM matrices. NAME is a character string with
%    the name of a MATLAB function (user written, or MATLAB
%    supplied).  The function is applied to each input argument
%    at the INDEPENDENT VARIABLE's values. Any CONSTANT/SYSTEM
%    matrices are held at their value while the sweep through
%    INDEPENDENT VARIABLE is done. Currently limited to 10
%    output arguments, and an unlucky 13 input arguments, which
%    is easily changable. VEVAL can be used to easily generate
%    VARYING system matrices.
% 
%    

function vfind
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [iv_value,iv_index] = vfind(condition,mat)
% 
%    Unary FIND function across INDEPENDENT VARIABLE.  The
%    variable condition can be any valid MATLAB conditional
%    statement, using the string 'mat' to identify the matrix,
%    and 'iv' as the independent variable's value.  Both the
%    VALUES and INDICES of the applicable independent variables
%    are returned.
% 
%    

function vinterp
%MATLAB Tour Partial Function Help:  mu_con
%
%  function y = vinterp(u,stepsize,finaliv,order)
%    or
%  function y = vinterp(u,varymat,order)
% 
%    The output vector Y (VARYING) is an interpolated version
%    of the input U.
% 
%    If the second argument is a positive scalar, then:
%        The INDEPENDENT VARIABLEs of Y start at
%        MIN(GETIV(U)) and finish at FINALIV (or
%        MAX(GETIV(U)) if only 2 arguments), in
%        increments of STEPSIZE.  Hence, this gives
%        uniform spacing of output IV's.
%    If the second argument is a VARYING matrix, then:
%        The INDEPENDENT VARIABLEs of Y are equal to
%        GETIV(VARYMAT).  In this case, 3rd argument
%        is interpolation ORDER.
% 
%    The choices of order are:
%        0	Zero order hold (default if only 3 args)
%        1	Linear interpolation
% 
%    

function vldiv
%MATLAB Tour Partial Function Help:  mu_con
%
%  function  out = vldiv(mat1,mat2)
% 
%    Left division for VARYING/CONSTANT matrices. Identical
%    to the MATLAB \ command, but works on VARYING matrices
%    as well. MAT1\MAT2
% 
%    

function vrdiv
%MATLAB Tour Partial Function Help:  mu_con
%
%  function  out = vrdiv(mat1,mat2)
% 
%    Right division for VARYING/CONSTANT matrices.
%    Identical to the MATLAB / command, but works
%    on VARYING matrices as well MAT1/MAT2.
% 
%    

function vrho
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vrho(matin)
% 
%    Spectral radius of a square, VARYING/CONSTANT matrix.
%    The spectral radius is defined as MAX(ABS(EIG(MATIN)))
%    for a CONSTANT matrix and as  MAX(ABS(EIG(XTRACTI(MATIN,I))))
%    for each INDEPENDENT VARIABLE of the VARYING matrix MATIN.
% 
%    

function vtp
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vtp(mat)
% 
%    Transpose a VARYING/CONSTANT matrix
% 
%    

function vtrace
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = vtrace(mat)
% 
%    Trace of a VARYING/CONSTANT matrix, identical
%    to MATLAB's TRACE command, but works with
%    VARYING matrices also.
% 
%    

function add_disk
%MATLAB Tour Partial Function Help:  mu_con
%
%  add_disk
% 
%    Plots the unit disk (in the complex plane) on top
%    of any existing plot. This is useful when looking
%    at Nyquist plots. Currently, after running ADD_DISK
%    the graphics window status is HOLD OFF.
% 

function cf2sys
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sysout=cf2sys(sysrcf)
% 
%  Creates a SYSTEM/CONSTANT/VARYING matrix from a
%   coprime factorization.
% 
%  

function clyap
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [X,resid] = clyap(A,C))
% 
%    Solves the Lyapunov equation  A'*X + X*A + C'C = 0
%    CLYAP calls the subroutine SJH6 to solve the Lyapunov
%    equation using Cholesky factors. RESID is the norm
%    of residual error: norm(A'*X + X*A + C'C).
% 
%    

function crand
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = crand(dim1,dim2)
% 
%    Complex random matrix generator: generates a complex,
%    random matrix with a uniform distribution of dimension
%    DIM1 x DIM2. If only one dimension argument is given,
%    the output matrix is square.
% 
%    

function crandn
%MATLAB Tour Partial Function Help:  mu_con
%
%  function out = crandn(dim1,dim2)
% 
%    Complex random matrix generator: generates a complex,
%    random matrix with a normal distribution of dimension
%    DIM1 x DIM2. If only one dimension argument is given,
%    the output matrix is square.
% 
%    

function csord
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [v,t,flgout,reig_min,epkgdif] = csord(a,epp,flgord,flgjw,flgeig)
% 
%   This function produces an ordered complex schur matrix, T,
%   where
%               v' * a * v  = t = |t11  t12|
%                                 | 0   t22|.
%   and V'V = eye().
%   The MATLAB function SCHUR is called, which results in an
%   unordered Schur form matrix. A subroutine called CGIVENS
%   is used to form a complex Givens rotation matrix which
%   orders the T matrix in a user-defined manner. A series
%   of input flags can be set:
% 
%   EPP           user supplied zero tolerance (default EPP=1e-9)
%   FLGORD = 0    order eigenvalues in ascending real part (default)
%          = 1    partial real part ordering, <0 , =0, >0
%   FLGJW  = 0    no exit condition on eigenvalue location (default)
%          = 1    exit if jw-axis eigenvalue is detected (see JWHAMTST)
%   FLGEIG = 0    no exit condition on half-plane eigenvalue
%                 distribution (default)
%          = 1    exit if
%                 length(real(eigenvalue)>0) ~= length(real(eigenvalue)<0)
% 
% 
%   The output flag FLGOUT is nominally 0. If there are jw-axis
%   eigenvalues, FLGOUT is set to 1. If there are an unequal
%   number of positive and negative eigenvalues, FLGOUT is set
%   to 2. If both conditions occur, FLGOUT = 3. The minimum
%   real part of the eigenvalues is output in REIG_MIN.
%   EPKGDIF is a comparison of two different jw-axis tests.
% 
%   

function mfilter
%MATLAB Tour Partial Function Help:  mu_con
%
%  function sys = mfilter(fc,ord,type,psbndr)
% 
%   Calculates, as a SYSTEM, a single-input, single-output
%   analog filter.  The cutoff frequency (Hertz) is FC and the
%   filter order is ORD.  The string variable, TYPE,
%   specifies the type of filter and may be one of the
%   following.
% 
%     'butterw'     Butterworth
%     'cheby'       Chebyshev
%     'bessel'      Bessel
%     'rc'          series of resistor/capacitor filters
% 
%   The dc gain of each filter (except even order Chebyshev)
%   is set to unity.   The argument PSBNDR specifies the
%   Chebyshev passband ripple (in dB).  At the cutoff frequency,
%   the magnitude is -PSBNDR dB.  For even order Chebyshev
%   filters the DC gain is also -PSBNDR dB.
% 
%   The Bessel filters are calculated
%   using the recursive polynomial formula.  This is
%   poorly conditioned for high order filters (order > 8).
% 

function negangle
%MATLAB Tour Partial Function Help:  mu_con
%
%  function y = negangle(x)
% 
%    Calculate the angle of X, in the range 0 to -2 pi radians.

function ric_eig
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [x1,x2,fail,reig_min,epkgdif] = ric_eig(ham,epp,balflg)
% 
%   Solves the eigenvalue problem associated with the
%   stabilizing solution (A+R*X stable) of the Riccati equation
% 
%                A'*X + X*A + X*R*X - Q = 0.
% 
%   An eigenvalue decomposition is used to obtain the stable
%   invariant subspace of the Hamiltonian matrix, HAM,
%   which contains the above variables in the following format:
% 
%        HAM = [A  R; Q  -A'].
% 
%   If HAM has no jw axis eigenvalues, there exists n x n matrices
%   X1 and X2 such that [ X1 ; X2 ] spans the n-dimensional
%   stable-invariant subspace of HAM. IF X1 is invertible, then
%   X = X2/X1 satisfies the Riccati equation, and results in A+RX being
%   stable. FAIL is returned with a value of 1 if jw-axis eigenvalues
%   of HAM are found. An eigenvalue is considered to be purely
%   imaginary if the magnitude of the real part is less than EPP.
%   The minimum real part of the eigenvalues is returned in REIG_MIN.
%   The default value for EPP is 1e-10.
% 
%   BALFLG determines whether to balance HAM prior to solving the
%   Riccati equation. Setting BALFLG to 0 balances HAM and setting
%   BALFLG to a nonzero value does not. The default is BALFLG set to 0.
% 
%   This can give incorrect results if HAM is not diagonalizable,
%   in this case it is better to use RIC_SCHR.
%   EPKGDIF is a comparison of two different jw-axis tests.
% 
%   

function ric_schr
%MATLAB Tour Partial Function Help:  mu_con
%
%  function [x1,x2,fail,reig_min,epkgdif] = ric_schr(ham,epp,balflg)
% 
%   Solves the eigenvalue problem associated with the
%   stabilizing solution (A+R*X stable) of the Riccati equation
% 
%                A'*X + X*A + X*R*X - Q = 0.
% 
%   A real Schur decomposition is used to obtain the stable
%   invariant subspace of the Hamiltonian matrix, HAM,
%   which contains the above variables in the following format:
% 
%        HAM = [A  R; Q  -A'].
% 
%   If HAM has no jw-axis eigenvalues, there exists n x n matrices
%   x1 and x2 such that [ x1 ; x2 ] spans the n-dimensional
%   stable-invariant subspace of HAM. IF x1 is invertible, then
%   X := x2/x1 satisfies the Riccati equation, and results in A+RX being
%   stable. the output flag FAIL is nominally 0. if there are jw-axis
%   eigenvalues, FAIL is set to 1. if there are an unequal
%   number of positive and negative eigenvalues, FAIL is set
%   to 2. if both conditions occur, FAIL = 3.
% 
%   RIC_SCHR calls CSORD to produce an ordered complex Schur
%   form. This is converted to a real Schur form, and yields
%   the desired stable, invariant subspace of the Hamiltonian.
%   The minimum absolute value of the  real parts
%   of the eigenvalues is output to REIG_MIN.
% 
%   BALFLG is a flag whether to balance HAM prior to solving the
%   Riccati equation. Setting BALFLG to 0 balances HAM and setting
%   BALFLG to 1 does not. The default is BALFLG set to 0.
%   EPKGDIF is a comparison of two different jw-axis tests.
% 
%   

function unum
%MATLAB Tour Partial Function Help:  mu_con
%
%  function numinputs = unum(mat)
% 
%    Returns number of inputs of SYSTEM matrix.
%    Returns column dimension of a CONSTANT matrix.
%    Returns column dimension of a VARYING matrix.
%    Returns 0 for a EMPTY matrix.
% 
%    

function xnum
%MATLAB Tour Partial Function Help:  mu_con
%
% function numstates = xnum(sys)
% 
%    Returns number of states of SYSTEM matrix.
%    Returns 0 for a CONSTANT or EMPTY matrix,
%    and -1 for a VARYING matrix.
% 
%    

function ynum
%MATLAB Tour Partial Function Help:  mu_con
%
% function numoutputs = ynum(mat)
% 
%    Returns number of outputs of SYSTEM matrix.
%    Returns row dimension of a CONSTANT matrix.
%    Returns row dimension of a VARYING matrix.
%    Returns 0 for a EMPTY matrix.
% 
%    

