How to return elements of 'A' using indices of 'B' ?

1 Ansicht (letzte 30 Tage)
Tomaszzz
Tomaszzz am 25 Jan. 2022
Beantwortet: KSSV am 25 Jan. 2022
Hi all,
I have two signals 'A" and 'B' (attached) collected at the same time (same number of frames). I have identified 8 indices (frame numbers) in ''a'' (attached "a_indices'). Now I want:
  • Return and save elements of 'b' between "a' indices 1-2, 2-3, 3-4, 4-5, 5-6, 6-7, 7-8
Can you help please?

Akzeptierte Antwort

KSSV
KSSV am 25 Jan. 2022
a = thigh_orient_y ;
b = shank_orient_y ;
idx = main_peak_location ;
n = length(idx)-1 ;
iwant = cell(n,1) ;
for i = 1:n
iwant{i} = b(idx(i):idx(i+1)) ;
end

Weitere Antworten (0)

Kategorien

Mehr zu Genomics and Next Generation Sequencing finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by