renamefields: Rename some field names in a struct

버전 1.0.0.0 (4.42 KB) 작성자: Bill Whiten
Changes struct field names from cell array list of old names to names in list of new names
다운로드 수: 100
업데이트 날짜: 2017/7/18

라이선스 보기

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

인용 양식

Bill Whiten (2024). renamefields: Rename some field names in a struct (https://www.mathworks.com/matlabcentral/fileexchange/63754-renamefields-rename-some-field-names-in-a-struct), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2017a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Structures에 대해 자세히 알아보기
태그 태그 추가

Community Treasure Hunt

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

Start Hunting!

renamefieldsfldr/

버전 게시됨 릴리스 정보
1.0.0.0

Update image
Image update
Add reference to selectfields

Text updated
Update image
Image update
Another image