Hi. I am working with a structure array, and I want to modify the structure based on a condition on the field entries.
For example,
Here is the input,
S(1).f1=[1:100] and S(2).f2=[2:101];S(2).f1=[40:120] and S(2).f2=[60:140]S(3).f1=...... and S(3).f2=.....S(4).f1=.... and S(4).f2=.......S(i).f1=.... and S(i).f2=....
Can anyone suggest me some smart way to do this.
Conditions on input Output
S(1).f1>=0 and S(1).f1<=50 then ——> S(1).f1=[1:50] and S(1).f2=[2:51]
S(1).f1>50 and S(1).f1<=100 then ——>S(2).f1=[51:100] and S(2).f2=[52:101]
…. so on
Now, the same process for original/input S(2).f1, S(3).f1 …. S(i).f1 to re-form the structure.
After, modification the final step is to delete S(i) if the size of S(i).f1 is < 5.
Best Answer