Structure filed decapsulator

版本 1.0.1 (1.4 KB) 作者: Jungmin kim
This function creates variables in the workspace for each struct field with the field's name & value
1.0 次下载
更新时间 2024/3/30

查看许可证

This function creates a variable in the executed workspace for each of the fields in the struct with the name and value of each field. It's intended to run in a local function, but it can also work elsewhere, probably.
This function only works when executed in the following manner:
function xxx = yyy(zzz)
evalComment = decapsulator(config,'config',0); % 0 is not vorbose, 1 is verbose at command line
eval(evalComment);
%%% You can play every val in the structure !!!
end
The idea of this function is to create an evalComment when varnargin is 3, and a function that is executed by eval when varargin is 4.
Good luck, commander !

引用格式

Jungmin kim (2024). Structure filed decapsulator (https://www.mathworks.com/matlabcentral/fileexchange/162046-structure-filed-decapsulator), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2024a
兼容任何版本
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

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

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

A new signature image is uploaded

1.0.0