selectfields: Select specified field names from a struct

Selects fields listed in a cell array from a struct

이 제출물을 팔로우합니다

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 (2026). selectfields: Select specified field names from a struct (https://kr.mathworks.com/matlabcentral/fileexchange/63774-selectfields-select-specified-field-names-from-a-struct), MATLAB Central File Exchange. 검색 날짜: .

도움

도움 받은 파일: renamefields: Rename some field names in a struct

도움 준 파일: Optional function arguments

카테고리

Help CenterMATLAB Answers에서 Structures에 대해 자세히 알아보기

일반 정보

MATLAB 릴리스 호환 정보

  • 모든 릴리스와 호환

플랫폼 호환성

  • Windows
  • macOS
  • Linux
버전 퍼블리시됨 릴리스 정보 Action
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