Contenuto principale

Variabili del workspace e file MAT

Gestire i dati nel workspace di MATLAB®

Il workspace contiene variabili create dall'utente o importate in MATLAB da file di dati o da altri programmi. È possibile visualizzare e modificare i contenuti del workspace nel pannello Workspace o nella finestra di comando. Per maggiori informazioni, vedere Create and Edit Variables.

Le variabili del workspace non vengono conservate quando si esce da MATLAB. Per utilizzare i dati tra più sessioni, salvarli in un file compresso con estensione .mat, chiamato file MAT. È possibile ripristinare i dati salvati caricando un file MAT in MATLAB. Per maggiori informazioni, vedere Salvataggio e caricamento delle variabili del workspace.

Strumenti

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

Attività di Live Editor

Importazione dei datiImport data from a file in the Live Editor (Da R2023a)

Funzioni

loadCaricare le variabili dal file al workspace
saveSalvare le variabili dal workspace a un file
matfileAccess and change variables in MAT-file without loading file into memory
dispVisualizzare il valore della variabile
formattedDisplayTextCapture display output as string (Da 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

Argomenti

Risoluzione dei problemi

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.

Informazioni complementari