Contenu principal

Variables de l’espace de travail et fichiers MAT

Gérer des données dans l’espace de travail MATLAB®

L’espace de travail contient les variables que vous créez ou importez dans MATLAB à partir de fichiers de données ou d’autres programmes. Vous pouvez afficher et modifier le contenu de l’espace de travail dans le panneau de l’espace de travail ou la fenêtre de commande. Pour plus d’informations, consultez Create and Edit Variables.

Les variables de l'espace de travail ne sont pas sauvegardées lorsque vous quittez MATLAB. Pour utiliser vos données dans plusieurs sessions, enregistrez-les dans un fichier compressé avec une extension .mat, appelé fichier MAT. Vous pouvez restaurer les données enregistrées en rechargeant un fichier MAT dans MATLAB. Pour plus d’informations, consultez Save and Load Workspace Variables.

Outils

Workspace PanelInteractively manage workspace contents
Variables EditorInteractively view, edit, and analyze workspace variables
Import ToolImport data from file

Tâches du Live Editor

Import DataImport data from a file in the Live Editor (depuis R2023a)

Fonctions

loadLoad variables from file into workspace
saveSave variables from workspace to file
matfileAccess and change variables in MAT-file without loading file into memory
dispAfficher la valeur d’une variable
formattedDisplayTextCapture display output as string (depuis R2021a)
whoList variables in workspace
whosList variables in workspace, with sizes and types
clearRemove items from workspace, freeing up system memory
clearvarsClear variables from memory

Rubriques

Résolution des problèmes

Unexpected Results When Loading Variables Within a Function

If you have a function that loads data from a MAT-file and find that MATLAB does not return the expected results, check whether any variables in the MAT-file share the same name as a MATLAB function.

Informations connexes