필터 지우기
필터 지우기

how to delete field in struct in loop?

조회 수: 2 (최근 30일)
Sagar Dhage
Sagar Dhage 2014년 9월 11일
답변: Andrei Bobrov 2014년 9월 11일
In have struct A having fields A1(2x1), A2(2x1), A3(12x1) ....A100(23x1). I want to delete fields whose size is (2x1). how to delete it

채택된 답변

Andrei Bobrov
Andrei Bobrov 2014년 9월 11일
n1 = fieldnames(A);
Aout = rmfield(A,n1(cellfun(@numel,struct2cell(A)) == 2));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by