书目详情:
PrefaceTable of ContentsChapter 11.1 Finite State Machines1.2 Event-Driven Systems1.3 Construction of Finite-State Machines with Stateflow1.4 Procedure for Creating a Stateflow Chart1.5 Summary1.6 Exercise for the Reader1.7 Solution to the End-of-Chapter ExerciseChapter 22.1 Truth Tables in Stateflow2.2 Summary2.3 Exercises2.4 Solution to End-of-Chapter ExercisesChapter 33.1 Introduction to Embedded MATLAB Functions3.2 Building the Model with a Stateflow Embedded MATLAB Function3.3 Programming the Stateflow Chart with an Embedded MATLAB Function3.4 Simulation of the Matrix Operations Stateflow Chart3.5 Summary3.6 Exercises for the Reader3.7 Solution to the End-of-Chapter ExercisesChapter 44.1 Introduction to Embedded MATLAB Functions4.2 Summary4.3 Exercises for the Reader4.4 Solution to the End-of-Chapter ExercisesChapter 55.1 Introduction to Graphical Functions5.2 Creating a Graphical Function5.3 Subcharts5.4 Exporting Graphical Functions to Stateflow5.5 Summary5.6 Exercise for the Reader5.7 Solution to the End-of-Chapter ExerciseChapter 66.1 The Stateflow Connective Junction Tool6.2 Creating a Connective Junction6.3 Changing Connective Junction Size6.4 Changing Connective Junction Properties6.5 Uses of Connective Junctions6.6 Summary6.7 Exercise for the Reader6.8 Solution to the End-of-Chapter ExerciseChapter 77.1 History Junction Defined7.2 The Stateflow History Junction Tool7.3 Changing the History Junction Size7.4 Changing History Junction Properties7.5 Entering a State7.6 Executing an Active State7.7 Exiting an Active State7.8 Execution Order for Parallel States7.9 Transitions7.10 Transition Connections7.11 Inner Transitions7.12 Summary7.13 Exercise for the Reader7.14 Solution to the End-of-Chapter ExerciseChapter 88.1 Creating a Box8.2 Changing a State to a Box8.3 Using Boxes in Stateflow8.4 SummaryChapter 99.1 Mealy Machine Defined9.2 Moore Machine Defined9.3 Mealy and Moore Machines in Stateflow9.4 Creating a Mealy Chart9.5 Creating a Moore Chart9.6 Changing Chart Type9.7 Debugging Mealy and Moore Charts9.8 Summary9.9 Exercises for the Reader9.10 Solution to the End-of-Chapter ExercisesAppendix AA.1 MATLAB® and Simulink®A.2 Command WindowA.3 Roots of PolynomialsA.4 Polynomial Construction from Known RootsA.5 Evaluation of a Polynomial at Specified ValuesA.6 Rational PolynomialsA.7 Using MATLAB to Make PlotsA.8 SubplotsA.9 Multiplication, Division, and ExponentiationA.10 Script and Function FilesA.11 Display FormatsAppendix BB.1 Simulink and its Relation to MATLABB.2 Simulink DemosAppendix CMasked Subsystemshis appendix presents an overview of masked subsystems, and a step-by-step procedure to create custom user interfaces, i.e., masks for Simulink subsystems.C.1 Masks DefinedA mask is a custom user interface for a subsystem. A masked subsystem conceals the subsystems contents, and it appear to the user as an atomic block with its own icon and parameter dialog box. However, a masked subsystem provides only graphi...C.2 Advantages Using Masked SubsystemsA masked subsystem allows us to1. Replace the parameter dialogs of a subsystem and its contents with a single parameter dialog with its own block description, parameter prompts, and help text.2. Replace a subsystems standard icon with a custom icon that shows its purpose.3. Prevent accidental modification of subsystems by concealing their contents behind a mask.4. Placing a masked subsystem in a library. We can also mask S-Function and Model blocks.C.3 Mask FeaturesMasks can include any of the following features:Mask Icon - The mask icon replaces a subsystems standard icon, i.e., it appears in a block diagram in place of the standard icon for a subsystem block. Simulink uses MATLAB code that we supply to draw the custom icon. We can use any MATLAB d...Mask Parameters - Masked subsystems allow us to define a set of user-specified parameters. Simulink stores the values of these parameters in the mask workspace as the value of a variable whose name you specify. These associated variables allo...Mask Parameter Dialog Box - The mask parameter dialog box contains controls that enable a user to set the values of the masks parameters and hence the values of any internal parameters linked to the mask parameters. The mask parameter dialog...Mask Initialization Code - The initialization code is MATLAB code that you specify and that Simulink runs to initialize the masked subsystem at critical times, such as model loading and the start of a simulation run see Initialization Pane)....Mask Workspace - Simulink associates a workspace with each masked subsystem that you create. Simulink stores the current values of the subsystems parameters in the workspace as well as any variables created by the blocks initialization code...A block parameter expression can refer only to variables defined in the mask workspaces of the subsystem or nested subsystems that contain the block or in the models workspace.A valid reference to a variable defined on more than one level in the model hierarchy resolves to the most local definition.For example, let us suppose that model M contains masked subsystem A, which contains masked subsystem B. Also, let us suppose that B refers to a variable x that exists in both As and Ms workspaces. In this case, the reference resolves to th...A masked subsystems initialization code can refer only to variables in its local workspace.The mask workspace of a Model block is not visible to the model that it references. Any variables used by the referenced model must resolve to workspaces defined in the referenced model or to the base i.e., the MATLAB) workspace.C.4 Creating a Masked SubsystemIt is best to illustrate the creation of a masked subsystem with an example.Example C.1The Simulink model in Figure C.1 below implements the quadratic equation .Figure C.1. Simulink model for Example C.1To create a subsystem, we encircle all blocks except the Unknown x and Display blocks, and from the Edit drop menu we select Create Subsystem. The model now appears as shown in Figure C.2.Figure C.2. The model for Example C.1 shown as a subsystem blockTo see the contents of the Subsystem in Figure C.2, we double-click the Subsystem block and now the model appears as shown in Figure C.3.Figure C.3. The contents of the subsystem blockFrom the Edit drop menu we click on the Mask Subsystem and the Mask Editor window appears as shown in Figure C.4. With the Icon tab selected as shown in Figure C.4, we position the text cursor in the Drawing commands pane, and we enter the MA...Figure C.4. The Mask Editor window for Example c.1Figure C.5. The masked subsystem with an imported imageWe right-click on the Subsystem block in Figure C.5, and from the drop menu we select Edit Mask. From the Mask Editor window which appears, we select the Parameters tab shown in Fig ure C.6 below.Figure C.6. The Parameters tab for the Mask Editor windowWe select the Add tool and the Mask Editor window now appears as shown in Figure C.7.Figure C.7. The Mask Editor window for specifying the attributes of the masked parametersThe Mask Editor in Figure C.7 is used to specify the attributes of the masked parameters. The Prompt column under Dialog parameters is used as a text label to describe the parameter. For our example we enter Constant a, Constant b, and Consta...Figure C.8. The Masked Editor with the equation constants specifiedWe right-click on the masked subsystem block shown in Figure C.5, Page C-5, and in the Func tion Block Parameters dialog box we enter the values 1, -5, and 6 for the variables a, b, and c respectively, as shown in Figure C.9.Figure C.9. The Function Block Parameters window with the values of the constantsWith the variables defined as above, the masked subsystem implements the quadratic equationand the roots of this equation are and . Our model is tested for the first root as shown in Figure C.10.Figure C.10.The Mask Editor also contains the Initialization tab that allows us to enter MATLAB commands that initialize the masked subsystem, and the Documentation tab that lets us define or modify the type description and help text for a masked subsyst...Figure C.11. The Initialization tab for the Mask Editor WindowFigure C.12. The Documentation tab for the Mask Editor window.References and Suggestions for Further StudyIndex
评论: