load
Load variables from a file into the workspace.
Syntax
Section titled “Syntax”loadload(filename)load(filename, var1, var2, ...)S = load(filename)Description
Section titled “Description”Loads variables from a .mat (or compatible) file. Without an output assignment, the variables are placed directly in the current workspace. With output assignment, returns a struct whose fields are the loaded variables.
Without a filename, defaults to matlab.mat. Specifying variable names loads only those.
Examples
Section titled “Examples”load % loads matlab.mat into workspaceload('data.mat')S = load('data.mat'); % capture into struct