struct2vars

版本 1.0.0.1 (2.4 KB) 作者: Matthew Eicholtz
Convert scalar structure into variables.
441.0 次下载
更新时间 2016/5/27

查看许可证

编者注: 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>.

引用格式

Matthew Eicholtz (2024). struct2vars (https://www.mathworks.com/matlabcentral/fileexchange/57370-struct2vars), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.1

Added "See also" in description.
Minor edits to description.

1.0.0.0