Anmerkung des Herausgebers: This file was selected as MATLAB Central Pick of the Week
STRUCT2VARS Convert scalar structure into variables.
STRUCT2VARS(S) unpacks the input structure, instantiating a variable in
the caller workspace for each fieldname and its corresponding value. If a
variable name already exists in the caller workspace, it will be overwritten
by this function.
[A,B,C,___] = STRUCT2VARS(S) unpacks each field of the input structure
into the specified outputs, i.e. the first field of S will be stored in
output variable A, the second field of S will be stored in output
variable B, and so forth. The number of outputs must be less than or
equal to the number of fieldnames in the structure.
[___] = STRUCT2VARS(___,NAMES) allows the user to specify which
fieldnames are unpacked. The order provided by the user is the order in
which fields are unpacked.
See also VARS2STRUCT <http://www.mathworks.com/matlabcentral/fileexchange/57371-vars2struct>.
Zitieren als
Matthew Eicholtz (2026). struct2vars (https://de.mathworks.com/matlabcentral/fileexchange/57370-struct2vars), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
Tags
Quellenangaben
Inspiriert von: Pack & Unpack variables to & from structures with enhanced functionality
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0.1 | Added "See also" in description.
|
||
| 1.0.0.0 |
