keepfield
Versione 1.0.0.0 (1,4 KB) da
Brett Shoelson
Keep specified fields of a structure, discarding other fields.
ML provides a useful function RMFIELD to remove specified field(s) from a structure, but no corresponding function to KEEP specified field(s), removing the rest. This function addresses that discrepancy.
ex.:
a = dir('*.m');
b = keepfield(a,{'name','date'});
This is an exceptionally short but useful piece of code.
Cita come
Brett Shoelson (2024). keepfield (https://www.mathworks.com/matlabcentral/fileexchange/7031-keepfield), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Creato con
R14SP1
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxCategorie
Scopri di più su Structures in Help Center e MATLAB Answers
Tag
Riconoscimenti
Ispirato da: keep
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
Versione | Pubblicato | Note della release | |
---|---|---|---|
1.0.0.0 |