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일

0 개 추천

n1 = fieldnames(A);
Aout = rmfield(A,n1(cellfun(@numel,struct2cell(A)) == 2));

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2014년 9월 11일

답변:

2014년 9월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by