How to delete particular row from struct array?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi
I want to know is there any passible method to delete the entire data related to particular column value in struct array.
2 Kommentare
Akzeptierte Antwort
David Sanchez
am 9 Mai 2013
Hi, I think you are looking for this:
s=rmfield(s,field)
example of use:
s.a=1;
s.b=2;
s.c=3;
>> s
s =
a: 1
b: 2
c: 3
s=rmfield(s,'a');
>> s
s =
b: 2
c: 3
2 Kommentare
Weitere Antworten (1)
Azzi Abdelmalek
am 9 Mai 2013
s1=struct('a',num2cell(1:10),'b',num2cell(11:20),'c',num2cell(21:30))
label=9
s1(label)=[]
0 Kommentare
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!