rmfield
구조체에서 필드 제거
설명
예제
단일 필드 제거하기
a
, b
, c
라는 이름의 필드를 가진 스칼라 구조체를 정의합니다.
s.a = 1; s.b = 2; s.c = 3;
필드 b
를 제거합니다.
field = 'b';
s = rmfield(s,field)
s = struct with fields:
a: 1
c: 3
여러 필드 제거하기
first
, second
, third
, fourth
라는 이름의 필드를 가진 스칼라 구조체를 정의합니다.
S.first = 1; S.second = 2; S.third = 3; S.fourth = 4;
필드 first
와 fourth
를 제거합니다.
fields = {'first','fourth'}; S = rmfield(S,fields)
S = struct with fields:
second: 2
third: 3
입력 인수
s
— 입력 구조체
구조체형 배열
입력 구조체로, 구조체형 배열로 지정됩니다.
데이터형: struct
field
— 필드 이름
문자형 배열 | 문자형 벡터로 구성된 셀형 배열 | string형 배열
필드 이름으로, 문자형 배열, 문자형 벡터로 구성된 셀형 배열 또는 string형 배열로 지정됩니다.
예: 'f1'
예: {'f1';'f2'}
데이터형: char
| cell
| string
확장 기능
스레드 기반 환경
MATLAB®의 backgroundPool
을 사용해 백그라운드에서 코드를 실행하거나 Parallel Computing Toolbox™의 ThreadPool
을 사용해 코드 실행 속도를 높일 수 있습니다.
이 함수는 스레드 기반 환경을 완전히 지원합니다. 자세한 내용은 스레드 기반 환경에서 MATLAB 함수 실행하기 항목을 참조하십시오.
분산 배열
Parallel Computing Toolbox™를 사용하여 대규모 배열을 클러스터의 결합된 메모리에 걸쳐 분할할 수 있습니다.
이 함수는 분산 배열을 완전히 지원합니다. 자세한 내용은 분산 배열을 사용하여 MATLAB 함수 실행 (Parallel Computing Toolbox) 항목을 참조하십시오.
버전 내역
R2006a 이전에 개발됨
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)