selectfields: Select specified field names from a struct

버전 2.0.0.0 (4.38 KB) 작성자: Bill Whiten
Selects fields listed in a cell array from a struct
다운로드 수: 94
업데이트 날짜: 2019/3/13

라이선스 보기

Selects fields listed in a cell array from a struct. Optional third
argument suppresses error message if struct does not contain
given field.
Exmples:
struct2=selectfields(struct1,{list of field names})
Moves field names and corresponding field content from struct1 to
struct2.

struct2=selectfields(struct1,{list of field names},true)
Moves field names and corresponding field content from struct1 to
struct2 if field name exists in struct1. Error messages for
missing field nanes are suppressed

See also renamefields

See doc selectfields

인용 양식

Bill Whiten (2024). selectfields: Select specified field names from a struct (https://www.mathworks.com/matlabcentral/fileexchange/63774-selectfields-select-specified-field-names-from-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!

selectfieldsfldr

버전 게시됨 릴리스 정보
2.0.0.0

Updated as suggested by Stephen

1.2.0.0

Reloaded, thanks Stephen

1.1.0.0

Updated to include struct arrays, thanks to Jos & Stephen.
still includes error messages

1.0.0.0