Modification programmatique du modèle
Découvrez les fondamentaux de la gestion programmatique des modèles dans Simulink®.
Fonctions
Ouvrir, enregistrer et fermer
simulink | Ouvrir la page de démarrage de Simulink |
start_simulink | Start Simulink without opening any windows |
slLibraryBrowser | Open, load, and close Simulink Library Browser, create and get handle of Library Browser object |
open_system | Open model, library, subsystem, or block dialog box |
load_system | Charger un modèle Simulink en mémoire |
save_system | Save Simulink model |
close_system | Close Simulink model window or block dialog box |
bdclose | Close any or all Simulink model windows unconditionally |
learning.simulink.launchOnramp | Open self-paced, interactive trainings (depuis R2019a) |
Ajouter et supprimer
add_block | Add block to model |
add_line | Add line to Simulink model |
delete_block | Delete blocks from Simulink system |
delete_line | Delete line from Simulink model |
add_param | Add parameter to Simulink model |
delete_param | Delete model parameter added with add_param
function |
Simulink.BlockDiagram.deleteContents | Delete graphical contents of model |
Simulink.SubSystem.deleteContents | Delete contents of subsystem |
Simulink.history.clear | Clear the Simulink start page and editor history (depuis R2020b) |
Créer
new_system | Create Simulink model or library in memory |
Simulink.createFromTemplate | Create model or project from template |
Simulink.BlockDiagram.createSubsystem | Create subsystem containing specified set of blocks |
Simulink.Annotation | Create and specify properties of text, image, and area annotations |
Obtenir et définir
docblock | Get or set editor invoked by Simulink DocBlock block |
gcs | Get path name of current system |
getfullname | Get path that identifies block or line |
gcb | Get path name of current block |
gcbh | Obtenir le handle du bloc actuel |
gcbp | Get Simulink.BlockPath object for current block (depuis R2019a) |
getSimulinkBlockHandle | Get block handle from block path |
get_param | Get parameter names and values |
set_param | Set Simulink parameter value |
Simulink.defaultModelTemplate | Set or get default model template |
getCurrentAnnotation | Get current annotation object (depuis R2019a) |
getCallbackAnnotation | Get annotation executing callback |
edittime.getDisplayIssues | Check whether model design warnings and errors is on (depuis R2019a) |
edittime.setDisplayIssues | Detect model design errors and warnings (depuis R2019a) |
Rechercher, remplacer et indexer
hilite_system | Highlight block, signal line, port, or annotation |
find_system | Find models, blocks, lines, ports, and annotations |
Simulink.FindOptions | Specify options for finding blocks in models and subsystems |
Simulink.findTemplates | Find model or project templates with specified properties |
Simulink.allBlockDiagrams | Find loaded Simulink models and libraries |
Simulink.findBlocks | Find blocks in Simulink models |
Simulink.findBlocksOfType | Find specified type of block in Simulink models |
replace_block | Replace blocks in Simulink model |
modelfinder | Search and open examples, models, and projects (depuis R2022a) |
modelfinder.setDefaultDatabase | Set default database to index models (depuis R2023b) |
modelfinder.registerFolder | Index models in Model Finder (depuis R2022a) |
modelfinder.unregisterFolder | Remove models from Model Finder (depuis R2022a) |
modelfinder.createDatabase | Create new database to index models (depuis R2023b) |
modelfinder.registerDatabase | Register database with Model Finder (depuis R2023b) |
modelfinder.unregisterDatabase | Remove database from Model Finder (depuis R2023b) |
modelfinder.setSearchDatabase | Set search scope to find models (depuis R2023b) |
Vérifier
isSimulinkStarted | Check whether Simulink is started (depuis R2020b) |
bdroot | Top-level model of current system |
bdIsLoaded | Determine whether model, subsystem, or library is loaded |
bdIsLibrary | Determine whether model is library |
bdIsDirty | Determine whether model, subsystem, or library has unsaved changes |
slIsFileChangedOnDisk | Determine whether model has changed since it was loaded |
Extraire et exporter
Simulink.SubSystem.copyContentsToBlockDiagram | Copy graphical contents from subsystem to another model |
Simulink.exportToTemplate | Create template from model or project |
Simulink.exportToVersion | Export model, library, or project for use in previous version of Simulink |
Simulink.MDLInfo | Extract SLX, SLXP, or MDL file information without loading file |
Simulink.MDLInfo.getDescription | Extract SLX, SLXP, or MDL file description without loading file |
Simulink.MDLInfo.getMetadata | Extract SLX, SLXP, or MDL file metadata without loading file |
Modifier
Simulink.BlockDiagram.expandSubsystem | Replace subsystem with subsystem contents |
Simulink.BlockDiagram.arrangeSystem | Improve layout of block diagram |
Simulink.BlockDiagram.routeLine | Route existing lines of model (depuis R2019a) |
slCharacterEncoding | Specify encoding to use in code generated from Simulink models |
frameedit | Open PrintFrame Editor to edit print frames for Simulink and Stateflow block diagrams |
Rubriques
- Programmatic Modeling Basics
Create models, add and connect blocks in models, set parameters and properties, and perform other modeling basics programmatically.
- Run Simulations Programmatically
Run simulations programmatically by writing scripts or by issuing commands in the MATLAB® Command Window.
- Programmatically Print Models from MATLAB Command Window
The MATLAB
print
command provides several options for printing Simulink models.
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)