keepfield

Keep specified fields of a structure, discarding other fields.
2,5K download
Aggiornato 3 mar 2005

Visualizza la licenza

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 Linux
Categorie
Scopri di più su Structures in Help Center e MATLAB Answers
Riconoscimenti

Ispirato da: keep

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0