SIMULINK的模块库介绍(1)Commonly UsedBus Creator Create signal busBus Selector Select signals from incoming busConstant Generate constant valueData Type Conversion Convert input signal to specified data typeDemux Extract and output elements of vector signalDiscrete-TimeIntegratorPerform discrete-time integration or accumulation of signal Gain Multiply input by constantGround Ground unconnected input portInport Create input port for subsystem or external input Integrator,IntegratorLimitedIntegrate signalLogical Operator Perform specified logical operation on inputMux Combine several input signals into vectorOutport Create output port for subsystem or external outputProduct Multiply and divide scalars and nonscalars or multiply and invert matricesRelational Operator Perform specified relational operation on inputs Saturation Limit range of signalScope and Floating Display signals generated during simulationScopeSubsystem,AtomicSubsystem,NonvirtualSubsystem,CodeReuseSubsystemRepresent system within another systemSum,Add,Subtract,Sum of ElementsAdd or subtract inputsSwitch Switch output between first input and third input based on value of second inputTerminator Terminate unconnected output portUnit Delay Delay signal one sample period(2)ContinuousDerivative Output time derivative of inputIntegrator,IntegratorLimitedIntegrate signalPID Controller Simulate continuous-or discrete-time PID controllersPID Controller(2 DOF) Simulate continuous-or discrete-time two-degree-of-freedom PID controllersSecond-OrderIntegrator,Second-Order Integrator LimitedIntegrate input signal twiceState-Space Implement linear state-space system Transfer Fcn Model linear system by transfer function Transport Delay Delay input by given amount of time Variable TimeDelay,VariableTransport DelayDelay input by variable amount of timeZero-Pole Model system by zero-pole-gain transfer function (3)DiscontinuitiesBacklash Model behavior of system with playCoulomb and ViscousModel discontinuity at zero,with linear gain elsewhere FrictionDead Zone Provide region of zero outputDead Zone Dynamic Set inputs within bounds to zeroHit Crossing Detect crossing pointQuantizer Discretize input at specified intervalRate Limiter Limit rate of change of signalRate Limiter Dynamic Limit rising and falling rates of signalRelay Switch output between two constantsSaturation Limit range of signalSaturation Dynamic Bound range of inputWrap To Zero Set output to zero if input is above threshold(4)DiscreteDifference Calculate change in signal over one time stepDiscrete Derivative Compute discrete time derivativeDiscrete Filter Model Infinite Impulse Response(IIR)direct form II filtersDiscrete FIR Filter Model FIR filtersDiscrete State-Space Implement discrete state-space systemDiscrete Transfer Fcn Implement discrete transfer functionDiscrete Zero-Pole Model system defined by zeros and poles of discrete transfer function Discrete-TimeIntegratorPerform discrete-time integration or accumulation of signalFirst-Order Hold Implement first-order sample-and-holdInteger Delay Delay signal N sample periodsMemory Output input from previous time stepPID Controller Simulate continuous-or discrete-time PID controllersPID Controller(2 DOF) Simulate continuous-or discrete-time two-degree-of-freedom PID controllersTapped Delay Delay scalar signal multiple sample periods and output all delayed versionsTransfer Fcn FirstOrderImplement discrete-time first order transfer functionTransfer Fcn Lead orLagImplement discrete-time lead or lag compensatorTransfer Fcn RealZeroImplement discrete-time transfer function that has real zero and no pole Unit Delay Delay signal one sample periodZero-Order Hold Implement zero-order hold of one sample period(5)Logic and BitOperationsBit Clear Set specified bit of stored integer to zeroBit Set Set specified bit of stored integer to oneBitwise Operator Specified bitwise operation on inputs Combinatorial Logic Implement truth tableCompare To Constant Determine how signal compares to specified constant Compare To Zero Determine how signal compares to zeroDetect Change Detect change in signal valueDetect Decrease Detect decrease in signal valueDetect Fall Negative Detect falling edge when signal value decreases to strictly negative value,and its previous value was nonnegativeDetect Fall Nonpositive Detect falling edge when signal value decreases to nonpositive value,and its previous value was strictly positiveDetect Increase Detect increase in signal valueDetect Rise Nonnegative Detect rising edge when signal value increases to nonnegative value,and its previous value was strictly negativeDetect Rise Positive Detect rising edge when signal value increases to strictly positive value,and its previous value was nonpositiveExtract Bits Output selection of contiguous bits from input signal Interval Test Determine if signal is in specified intervalInterval Test Dynamic Determine if signal is in specified intervalLogical Operator Perform specified logical operation on input Relational Operator Perform specified relational operation on inputs Shift Arithmetic Shift bits or binary point of signal(6)Lookup TablesDirect LookupTable(n-D)Index into N-dimensional table to retrieve element,column,or 2-D matrixInterpolation Using Prelookup Use precalculated index and fraction values to accelerate approximation of N-dimensional functionLookup Table Approximate one-dimensional functionLookup Table(2-D) Approximate two-dimensional functionLookup Table(n-D) Approximate N-dimensional functionLookup TableDynamicApproximate one-dimensional function using dynamic table Prelookup Compute index and fraction for Interpolation Using Prelookup blockSine,Cosine Implement fixed-point sine or cosine wave using lookup table approach that exploits quarter wave symmetry(7)Math OperationsAbs Output absolute value of inputAlgebraic Constraint Constrain input signal to zeroAssignment Assign values to specified elements of signalBias Add bias to inputComplex toMagnitude-AngleCompute magnitude and/or phase angle of complex signal Complex to Real-Imag Output real and imaginary parts of complex input signalDivide Divide one input by anotherDot Product Generate dot product of two vectorsFind Find nonzero elements in arrayGain Multiply input by constantMagnitude-Angle toComplexConvert magnitude and/or a phase angle signal to complex signal Math Function Perform mathematical functionMatrix Concatenate,Vector Concatenate Concatenate input signals of same data type to create contiguous output signalMinMax Output minimum or maximum input valueMinMax RunningResettableDetermine minimum or maximum of signal over time Permute Dimensions Rearrange dimensions of multidimensional array dimensions Polynomial Perform evaluation of polynomial coefficients on input valuesProduct Multiply and divide scalars and nonscalars or multiply and invert matricesProduct of Elements Copy or invert one scalar input,or collapse one nonscalar input Real-Imag to Complex Convert real and/or imaginary inputs to complex signalReshape Change dimensionality of signalRounding Function Apply rounding function to signalSign Indicate sign of inputSine Wave Function Generate sine wave,using external signal as time sourceSlider Gain Vary scalar gain using sliderSqrt,SignedSqrt,Reciprocal SqrtCalculate square root,signed square root,or reciprocal of square root Squeeze Remove singleton dimensions from multidimensional signal Sum,Add,Subtract,Sum of ElementsAdd or subtract inputsTrigonometricFunctionSpecified trigonometric function on inputUnary Minus Negate inputWeighted SampleTime MathSupport calculations involving sample time(8)Model VerificationAssertion Check whether signal is zeroCheck Discrete Gradient Check that absolute value of difference between successive samples of discrete signal is less than upper boundCheck Dynamic Gap Check that gap of possibly varying width occurs in range of signal's amplitudesCheck DynamicLower BoundCheck that one signal is always less than another signalCheck Dynamic Range Check that signal falls inside range of amplitudes that varies from time step to time stepCheck Dynamic UpperBoundCheck that one signal is always greater than another signal Check InputResolutionCheck that input signal has specified resolutionCheck Static Gap Check that gap exists in signal's range of amplitudesCheck Static Lower Bound Check that signal is greater than(or optionally equal to)static lower boundCheck Static Range Check that signal falls inside fixed range of amplitudesCheck Static UpperBoundCheck that signal is less than(or optionally equal to)static upper bound(9)Model-WideUtilitiesBlock Support Table View data type support for Simulink blocksDocBlock Create text that documents model and save text with modelModel Info Display revision control information in modelTimed-BasedGenerate linear models in base workspace at specific times LinearizationTrigger-BasedGenerate linear models in base workspace when triggered Linearization(10)Ports&SubsystemsTrigger Add trigger port to model or subsystemAction Port Implement Action subsystems used by if and switch control flow statements in Simulink softwareConfigurableSubsystemRepresent any block selected from user-specified library of blocks Enable Add enabling port to subsystemEnabled and Triggered Subsystem Represent subsystem whose execution is enabled and triggered by external inputEnabled Subsystem Represent subsystem whose execution is enabled by external inputFor Each Enable blocks inside For Each Subsystem to process elements or subarrays of input signal independentlyFor Each Subsystem Repeatedly perform algorithm on each element or subarray of input signal and concatenate resultsFor Iterator Repeatedly execute contents of subsystem at current time step until iteration variable exceeds specified iteration limitFor Iterator Subsystem Represent subsystem that executes repeatedly during simulation time stepFunction-Call Generator Execute function-call subsystem specified number of times at specified rateFunction-Call Split Provide junction for splitting function-call signalFunction-CallSubsystemRepresent subsystem that can be invoked as function by another block If Model if-else control flowIf Action Subsystem Represent subsystem whose execution is triggered by If blockInport Create input port for subsystem or external inputModel Include model as block in another modelOutport Create output port for subsystem or external outputSubsystem,AtomicSubsystem,NonvirtualSubsystem,CodeReuseSubsystemRepresent system within another systemSwitch Case Implement C-like switch control flow statementSwitch Case ActionSubsystemRepresent subsystem whose execution is triggered by Switch Case block Triggered Subsystem Represent subsystem whose execution is triggered by external inputWhile Iterator Subsystem Represent subsystem that executes repeatedly while condition is satisfied during simulation time step(11)Signal AttributesSignal Specification Specify desired dimensions,sample time,data type,numeric type,and other attributes of signalBus to Vector Convert virtual bus to vectorData Type Conversion Convert input signal to specified data typeData Type Conversion Inherited Convert from one data type to another using inherited data type and scalingData Type Duplicate Force all inputs to same data typeData Type Propagation Set data type and scaling of propagated signal based on information from reference signalsData Type ScalingStripRemove scaling and map to built in integer IC Set initial value of signalProbe Output signal's attributes,including width,dimensionality,sample time,and/or complex signal flagRate Transition Handle transfer of data between blocks operating at different rates Signal Conversion Convert signal to new type without altering signal values Weighted SampleTimeSupport calculations involving sample timeWidth Output width of input vector(12)Signal RoutingBus Assignment Replace specified bus elementsBus Creator Create signal busBus Selector Select signals from incoming busData Store Memory Define data storeData Store Read Read data from data storeData Store Write Write data to data storeDemux Extract and output elements of vector signalEnvironment Controller Create branches of block diagram that apply only to simulation or only to code generationFrom Accept input from Goto blockGoto Pass block input to From blocksGoto Tag Visibility Define scope of Goto block tagIndex Vector Switch output between different inputs based on value of first input Manual Switch Switch between two inputsMerge Combine multiple signals into single signalMultiport Switch Choose between multiple block inputsMux Combine several input signals into vectorSelector Select input elements from vector,matrix,or multidimensional signalSwitch Switch output between first input and third input based on value of second input(13)SinksDisplay Show value of inputOutport Create output port for subsystem or external output Scope and FloatingDisplay signals generated during simulationScopeStop Simulation Stop simulation when input is nonzeroTerminator Terminate unconnected output portTo File Write data to fileTo Workspace Write data to MATLAB workspaceXY Graph Display X-Y plot of signals using MA TLAB figure window (14)SourcesBand-Limited WhiteNoiseIntroduce white noise into continuous system Chirp Signal Generate sine wave with increasing frequency Clock Display and provide simulation time Constant Generate constant valueCounter Free-Running Count up and overflow back to zero after reaching maximum value for specified number of bitsCounter Limited Count up and wrap back to zero after outputting specified upper limit Digital Clock Output simulation time at specified sampling interval Enumerated Constant Generate enumerated constant valueFrom File Read data from MAT-fileFrom Workspace Read data from workspaceGround Ground unconnected input portInport Create input port for subsystem or external inputPulse Generator Generate square wave pulses at regular intervalsRamp Generate constantly increasing or decreasing signalRandom Number Generate normally distributed random numbersRepeating Sequence Generate arbitrarily shaped periodic signalRepeating Sequence Interpolated Output discrete-time sequence and repeat,interpolating between data pointsRepeating SequenceStairOutput and repeat discrete time sequenceSignal Builder Create and generate interchangeable groups of signals whose waveforms are piecewise linearSignal Generator Generate various waveformsSine Wave Generate sine wave,using simulation time as time source Step Generate step functionUniform RandomNumberGenerate uniformly distributed random numbers(15)User-DefinedFunctionsEmbedded MATLABInclude MATLAB code in models that generate embeddable C code FunctionFcn Apply specified expression to inputLevel-2 M-FileUse Level-2 M-file S-function in modelS-FunctionMATLAB Fcn Apply MATLAB function or expression to inputS-Function Include S-function in modelS-Function Builder Create S-function from C code that you provide(16)AdditionalMath&DiscreteAdditional Discrete Provide additional discrete math supportAdditional Increment or decrement value of signal by oneMath:Increment—Dec rement。