RenameField

버전 1.2.0.0 (14.6 KB) 작성자: Jan
Rename a fields of a struct - fast C-Mex
다운로드 수: 2.4K
업데이트 날짜: 2022/6/8

라이선스 보기

RenameField - Rename a fields of a struct
T = RenameField(S, Old, New)
INPUT:
S: Struct or struct array.
Old, New: CHAR or cell string (M version accept strings), name of the field to be renamed.
OUTPUT:
T: Struct S with renamed fields.
EXAMPLES:
S.A = 1; S.B = 2;
T = RenameField(S, 'B', 'C'); % T.A = 1, T.C = 2
This function was created after a discussion in Loren's blog:
Tested: Matlab 2009a/2015b/2018b, Win10, LCC3.8, BCC5.5, OpemWatcom 1.8, MSVC 2008
Compatibility to 64 bit, Linux, MacOS is assumed.
Look in the C-file for instructions to compile the Mex file at first.
A slower M-version is included.

인용 양식

Jan (2024). RenameField (https://www.mathworks.com/matlabcentral/fileexchange/28516-renamefield), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2018b
R2006a 이상 릴리스와 호환
플랫폼 호환성
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!
버전 게시됨 릴리스 정보
1.2.0.0

M version accepts strings.

1.1.0.0

Accept cell strings as input.

1.0.0.0