Structure filed decapsulator
Version 1.0.1 (1,36 KB) von
Jungmin kim
This function creates variables in the workspace for each struct field with the field's name & value
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 !
Zitieren als
Jungmin kim (2024). Structure filed decapsulator (https://www.mathworks.com/matlabcentral/fileexchange/162046-structure-filed-decapsulator), MATLAB Central File Exchange. Abgerufen .
Kompatibilität der MATLAB-Version
Erstellt mit
R2024a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
Version | Veröffentlicht | Versionshinweise | |
---|---|---|---|
1.0.1 | A new signature image is uploaded |
||
1.0.0 |