Vous suivez désormais cette soumission
- Les mises à jour seront visibles dans votre flux de contenu suivi
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails
Changes struct field names from cell array list of old names to
names in list of new names. Optional fourth argument suppresses
error message if struct does not contain an old name.
Examples
struct2=renamefields(struct1,{list old names},{list new names})
Changes the names given in "list old names" to those given
in "list new names"
struct2=renamefields(struct1,{list old names},{list new names},true)
Changes those names from old names, if present in struct1 to names
from new names
Can also swap names e.g.
struct2=renamefields(struct('a',1,'b',2,'c',3),{'a','b'},{'b','a'})
See also selectfields
See doc renamefields
Citation pour cette source
Bill Whiten (2026). renamefields: Rename some field names in a struct (https://fr.mathworks.com/matlabcentral/fileexchange/63754-renamefields-rename-some-field-names-in-a-struct), MATLAB Central File Exchange. Extrait(e) le .
Remerciements
A inspiré : selectfields: Select specified field names from a struct, Optional function arguments
Informations générales
- Version 1.0.0.0 (4,42 ko)
Compatibilité avec les versions de MATLAB
- Compatible avec toutes les versions
Plateformes compatibles
- Windows
- macOS
- Linux
| Version | Publié le | Notes de version | Action |
|---|---|---|---|
| 1.0.0.0 | Update image
Text updated
|
