La traduction de cette page n'est pas à jour. Cliquez ici pour voir la dernière version en anglais.
Scripts
Fichiers programme de base
Le script est le type de fichier programme le plus simple. Il permet d’automatiser une série de commandes MATLAB®, par exemple des calculs à exécuter de manière répétée depuis la ligne de commande ou une série de commandes auxquelles vous avez besoin de faire référence.
Fonctions
Rubriques
Programmes de base
- Create Scripts
Create a script in a new file or from commands in the Command History. - Add Comments to Code
Add comments to describe your code and allow others to understand it. - Find and Replace Text in Files and Go to Location
Find and replace text in the current file or multiple files, automatically rename variables or functions, and go to a location in a file. - Edit and Format Code
Use column selection, code autocompletions, refactoring, indentation, and code folding to edit your code and make it easier to read. - Create and Run Sections in Code
Divide MATLAB code files into sections and run all sections or run each section individually. (depuis R2021b) - Save and Back Up Code
Save and automatically create backup copies of files in the Editor and Live Editor. - Editor/Debugger Preferences
Use Editor/Debugger preferences to customize the Editor.
Ajouter des entrées et une sortie
- Scripts vs. Functions
Code files can be scripts that simply execute a series of MATLAB statements, or they can be functions that also accept input arguments and produce output. - Add Functions to Scripts
Add functions to scripts to reuse code within a script and avoid creating and managing separate function files.
Partager le code
- Publish and Share MATLAB Code
MATLAB provides options for presenting your code to others, including using publishing and creating live scripts and functions in the Live Editor.