Académique Documents
Professionnel Documents
Culture Documents
Program CC Command List ............................................................................................... 1 Conversions......................................................................................................................... 2 Transfer function to state space: ......................................................................................... 2 Display Functions ............................................................................................................... 3 String Functions .................................................................................................................. 3 Elementary Math Functions................................................................................................ 4 Filters .................................................................................................................................. 5 FFT Functions ..................................................................................................................... 6 Information Functions......................................................................................................... 6 Matrix Operations ............................................................................................................... 7 Matrix Building Functions.................................................................................................. 8 Matrix Decomposition Functions ....................................................................................... 8 Miscellaneous Functions..................................................................................................... 9 Optimal Control Functions ................................................................................................. 9 Plotting Functions ............................................................................................................... 9 Printing and Copying ........................................................................................................ 10 Simulation Functions ........................................................................................................ 11 Statistical Functions .......................................................................................................... 11 Transfer Functions ............................................................................................................ 12
CONVERSIONS
Analog to digital to wplane: bilinear convert zoh
wplane
fadeeva gep
gepper
numerator
Matrices to and from state space: pack unpack pack a,b,c,d into a quadruple go the other way
Change how transfer function coefficients are stored: chpzf chtcf chsingle chunitary Substitute for s or z: substitute scale shift substitute any transfer function for s substitute alpha*s for s substitute s-alpha for s change to pole-zero-form change to time-constant-form change to single polynomials change to unitary polynomials
DISPLAY FUNCTIONS
To display any variable: display disp format ridf stdisplay display the variable same thing, different name. change the format displays real, imag, damping, and frequency display all the structure members
To display transfer functions: pzf tcf sho single unitary pfe ilt pole-zero-form time-constant-form shorthand form (damping ratios and natural frequencies) single polynomials unitary polynomials partial fraction expansion inverse Laplace transform
To display an error or warning message from within a function: error warning display error message and stop execution display warning message and continue execution
STRING FUNCTIONS
To compute string operations: char findstr lower strcat strvcat strcmp strncmp strcmpi strncmpi strjust strmatch strrep strtok upper converts ASCII numbers to a string finds one string within another convert to lower case concatenates strings vertically concatenates strings compares strings compares first n characters of strings compares strings ignoring case compares first n characters of strings ignoring case justifies string vector finds possible matches for string replaces string with another finds token in string convert to upper case
To create formatted strings: printf sprintf mimics C printf function same but returns a string
Integer: ceil fix floor int rem round sign round towards positive infinity round towards zero round towards minus infinity same as fix remainder after division round towards nearest integer Signum function
Factors (integers, gcd and lcm also work with transfer functions): gcd greatest command divisor lcm least common multiple primefactors prime factors
FILTERS
The following functions create Laplace transform filters: bessel(omega,order) butterworth(omega,order) butter(omega,order) chebyshev(omega,ripple,order) integrator itae(omega,order) leadlag(omega,phi) notch(omega,zeta_n,zeta_d) onepole(a) onezero(a) pade(tau,order) pid(a,b,c) twopoles(zeta,omega) twozeros(zeta,omega)
FFT FUNCTIONS
To compute the digital Fourier transform using the fast Fourier transform (fft) algorithm: fft fftr fft2 ifft ifftr iff2 the fast Fourier transform version of fft for real inputs 2-dimensional fft the inverse fft opposite of fftr 2-dimensional inverse fft
To directly compute the digital Fourier transform: dft the digitial Fourier transform at selected frequencies
To change the time series before computing the fft: fftwin various windows applied to the fft input
To change the resulting frequency response: fftshift shifts the fft result fftshift2 2-dimensional shift logbin used for logarithmic bin averaging binavg compute bin averaging To estimate the frequency response of a system using ffts of the input and output time series: tfest transfer function estimation
INFORMATION FUNCTIONS
Information functions: help list what who whos winhelp help echoed to command window many different lists (use also Alt+x) list of functions list of variables list of variables with more detail windows help
Functions in place of structure members: cdim idim name odim rdim sdim type column dimension input dimension (same as cdim) variable name output dimension (same as rdim) row dimension state dimension variable type
Query functions based on dimensions: isnull isempty isscalar isvector ismatrix is3d TRUE if null same thing as isnull TRUE if 1x1 TRUE if a vector TRUE if any dimension >1 TRUE if #pages>1
Query functions based on variable type: iscomplex isint ispoly ispolym isp3d isglobal isquad isreal isstr istf istfm TRUE if a complex scalar TRUE if an integer TRUE if a polynomial TRUE if a polynomial matrix TRUE if a parameterized 3D matrix TRUE if global variable TRUE if # states > 0 TRUE if a real scalar TRUE if a string TRUE if a transfer function TRUE if a transfer function matrix
MATRIX OPERATIONS
all any cond conv cumprod cumsum det diff expm inv lls max min norm null pinv prod range rank rcond sort sum trace TRUE if all nonzero TRUE if any elements zero condition number convolution cumulative product cumulative sum determinant difference matrix exponential matrix inverse using Gaussian elimination linear least square problem maximum minimum matrix and vector norms null space using SVD pseudo-inverse using SVD product range space using SVD rank estimate of reciprocal condition sort in ascending order sum sum of diagonal elements 7
MISCELLANEOUS FUNCTIONS
Variables: clear global Evaluating strings: eval feval Files: load path save Quitting: exit quit Text editor: edit new edit text file new text file quit without query quit after query load variable files sets directory path save variable files execute a string variable execute a function passed as a string clear some or all variables declare global variables
PLOTTING FUNCTIONS
xy plots. plot loglog semilogx semilogy x versus y log10(x) versus log10(y) log10(x) versus y x versus log10(y)
Classical control plots: bode nichols nyquist rootlocus rl time stripchart log10(abs(s)) versus dB and phase of g(s) phase versus dB of g(s) real versus imaginary of g(s) real versus imaginary of locus of roots shorter name for rootlocus simulation response x versus multi-axis y
Defining where a plot is located in a plotview: figure gcf subplot defines the current figure returns name of current figure defines the current plot
Changing an existing plot (also use the plot option dialog box): axis grid hold line plotoption tile title xlabel ylabel ylabels y2label changes the axis limits includes a background grid plots new lines on same axis add a new line change any plot option tile the windows changes the title changes the x axis label changes the y axis label changes stripchart yaxis labels change right hand side y-axis label
Printing transfer functions: lpilt lpizt inverse Laplace transform inverse z transform 10
partial fraction expansion pole-zero-form shorthand form alternative name for lpsho single polynomials time-constant-form unitary polynomials
SIMULATION FUNCTIONS
chirp ilt input izt sim sumsines time timevec balreal chst conmat fsfb fsoi lft obsmat poleplace resid similarity sisoltf zeroreduce creates chirp time series computes time series of the inverse Laplace transform create time series of various types of inputs computes time series of the inverse z-transform linear simulation of transfer function or state space systems creates sum of sinusoid time series computes and plots simulation result creates vector containing timesState Space Quadruple Functions balanced realization change the number of states controllability matrix full state feedback full state output injection linear fractional transformation observability matrix pole placement residualization similarity transformation Computes loop transfer function with other loops closed reduces order of quadruple
STATISTICAL FUNCTIONS
corrcoef cov mean meansq median std var correlation coefficient covariance mean value mean square median standard deviation variance
11
TRANSFER FUNCTIONS
Robustness: airplanebw bandwidth delaymargin gainmargin margin mpmargin phasemargin Factorizations: blasche inner outer partial spectral Model reduction: effdelay hfa lfa maxtc near Design: imc pid poleplace More: bodegain der diophantine enter gcd laplace lcm order poles rlgain roots senter zeros ztransform low frequency gain derivative with respect to s or z solves polynomial diophantine equation enter transfer function using coefficients greatest common divisor returns the Laplace variable s least common multiple numerator and denominator polynomial orders returns complex vector with poles high frequency gain returns complex vector with roots enter transfer function using shorthand form coefficients returns complex vector with zeros returns the z-transform variable z. 12 internal model control problem proportional-integral-derivative controller transfer function version of the pole-placement problem effective delay high frequency approximation low frequency approximation max time constant pole zero cancellations blasche product inner factor outer factor partial factors spectral factors manual control bandwdith unit magnitude crossover delay margin gain margin different robustness margins peak magnification ratio phase margin