Inserting more rows between already existing rows of a structure
Afficher commentaires plus anciens
Hello,
I am trying to extract data of interest from a time data series in the form of episodes.
Y = accelerometer data
t = time data
pks & locs = location and amplitude of peaks of interest
I already have sections of data which could be data of interest into episodes in the structure:
n = amount of episodes
grp_pks(n).Y = Y(1,i_str:i_end);
grp_pks(n).t = t(1,i_str:i_end);
grp_pks(n).i = [i_str, i_end];
grp_pks(n).pks = pks;
grp_pks(n).locs = locs;
After analysing the peaks further, I want to devide the episodes when peaks are further apart then 2 sec and delete episodes with > 5 peaks.
Therefore, I would need to be able to insert extra n into the structure, e.g. having grp_pks(3) devided into grp_pks(3), grp_pks(4), grp_pks(5), ... without overwriting the grp_pks(4), grp_pks(5), ... . Is that possible? with Matrixes I would just do:
mtx_pks = [mtx_pks(1:2,:); pks; mtx_pks(4:end,:)];
but I am not sure how to tansfere that onto a structure.
Thank you
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Descriptive Statistics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!