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!