Documentation

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

Model Editing Fundamentals

Build block diagram models using blocks and signal lines

Learn the basics you need to build models and be productive in the Simulink® editing environment.

Build and Edit a Model in the Simulink Editor covers the complete modeling process, from starting the software to building the block diagram to simulating and viewing results. Master the tips, tricks, and shortcuts that speed up model building.

Parts of a Model introduces concepts and vocabulary that serve as a foundation for learning about and using Simulink beyond the basics.

Functions

simulink Open Simulink Start Page
start_simulink Start Simulink without opening any windows
slLibraryBrowser Open Simulink Library Browser
new_system Create Simulink model or library in memory
open_system Open Simulink model, library, subsystem, or block dialog box
load_system Invisibly load Simulink model
Simulink.createFromTemplate Create model or project from template
Simulink.findTemplates Find model or project templates with specified properties
Simulink.defaultModelTemplate Set or get default model template
add_block Add block to model
add_line Add line to Simulink model
replace_block Replace blocks in Simulink model
delete_block Delete blocks from Simulink system
delete_line Delete line from Simulink system
bdroot Return name of top-level Simulink system
find_system Find systems, blocks, lines, ports, and annotations
gcs Get pathname of current system
getfullname Get pathname of block or line
gcb Get path name of current block
gcbh Get handle of current block
getSimulinkBlockHandle Get block handle from block path
set_param Set system and block parameter values
get_param Get parameter names and values
add_param Add parameter to Simulink system
delete_param Delete system parameter added via add_param command
Simulink.BlockDiagram.createSubSystem Create subsystem containing specified set of blocks
Simulink.BlockDiagram.deleteContents Delete contents of block diagram
Simulink.BlockDiagram.expandSubsystem Expand subsystem contents to containing model level
Simulink.SubSystem.copyContentsToBlockDiagram Copy contents of subsystem to empty block diagram
Simulink.SubSystem.deleteContents Delete contents of subsystem
save_system Save Simulink system
close_system Close Simulink system window or block dialog box
Simulink.exportToTemplate Create template from model or project
Simulink.exportToVersion Export model or library for use in previous version of Simulink
bdclose Close any or all Simulink system windows unconditionally
bdIsLoaded Whether block diagram is in memory
bdIsLibrary Whether block diagram is a library
slCharacterEncoding Change MATLAB character set encoding
slIsFileChangedOnDisk Determine whether model has changed since it was loaded
print Print figure or save to specific file format
orient Hardcopy paper orientation
frameedit Edit print frames for Simulink and Stateflow block diagrams

Examples and How To

Build and Edit Models

Start the Simulink Software

To build Simulink models, use the Simulink start page, the Simulink Editor, and the Library Browser.

Create Models and Open Existing Models

Use the Simulink Start Page to select a model template, open recent models, and find examples.

Model Editing Environment

Use the Simulink Editor and the Library Browser to create models and set model properties.

Parts of a Model

The basic parts of a model include blocks, signals, parameters, and properties.

Keyboard and Mouse Actions for Simulink Modeling

Interact with the Simulink Editor using keyboard commands and mouse actions.

Build and Edit a Model in the Simulink Editor

Assemble models using the Simulink Editor, and learn tips and tricks for being productive in the editing environment.

Adjust Visual Presentation to Improve Model Readability

Improve model readability by flipping and rotating blocks, changing fonts, using color, and boxing and labeling areas.

Find Model Elements in Simulink Models

Use different approaches to locate model elements, based on model complexity and goals.

Update Diagram and Run Simulation

Updating the diagram provides the simulation with the results of the latest changes that you have made to a model.

Model Files

Save a Model

Save models, specify valid model names, file format, and character encoding. Export to different versions of Simulink.

Create a Template from a Model

Create a template to reuse customized settings in new models, including configuration settings, blocks, and visual presentation.

Manage Model Versions and Specify Model Properties

View and edit model version information, history, callback functions, and the model description.

Simulink API

Programmatic Modeling Basics

Create models, add and connect blocks in models, set parameters and properties, and perform other modeling basics programmatically.

Was this topic helpful?