I am new to MATLAB and expecting some help. I have a structure array (1 x 50,000) with 30 fields. I want to divide this structure into multiple structures based on a condition.
I tried sometheing like this. Let the main structure be vel and it has 30 fields. Based on the values of the parameters in the field y of the structure vel, I want to create sub-structures.
vel_sub1(i)=vel(i) % creating a new structure
vel_sub(i)= % null
if y>=20 && y<=100
vel_sub2(i)=vel(i) % creating another sub-structure
vel_sub(2)= % null
But, unfortunatley I am getting some empty fields in the sub-structure, is there any smart way to implement this without any empty rows in the fields?