keepfield

Keep specified fields of a structure, discarding other fields.
2,5K téléchargements
Mise à jour 3 mars 2005

Afficher la licence

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.

Citation pour cette source

Brett Shoelson (2026). keepfield (https://fr.mathworks.com/matlabcentral/fileexchange/7031-keepfield), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R14SP1
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Structures dans Help Center et MATLAB Answers
Remerciements

Inspiré par : keep

Version Publié le Notes de version
1.0.0.0