Delete some columns from structure array
이전 댓글 표시
Hi. I am working with a structure array S (1 X 50,000) with 10 fields in which some columns are multiuple entries ands sub-set of another column.
Here is the input,
S(1).f1=[10,20,30 40,50,60], S(1).f2=[100,20,50,60,70,140],.........S(1).f10=[11,22,33,44,55,66];
S(2).f1=[56,98,74,87,99] and S(2).f2=[101,54,69,20,11],....... S(2).f10=.........[54,55,65,74,90];
S(3).f1=...... and S(3).f2=.....
S(4).f1=.... and S(4).f2=.....
.
.
S(13).f1=[10,20,30 40,50,60,70,80,90,100], S(13).f2=[100,20,50,60,70,140,160,200,220,300],.........S(13).f10=[11,22,33,44,55,66,65,72,34,61];
.
.
.
As we can see S(1) is a sub-set of S(13). I want to write a loop to compare all the columns and retain only the ones with maximum length; meaning that to delete S(1) and retain S(13) in the above example.
Can someone please help me with this.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!