I have a signal ( see figure an attached).
I want to identify loactions and values of indices circled bold black (first through before main through indicated by blue star)
I have values and locations of all the remaining indices (attached a b c and d).
I am able to identify indices circled red using the code below. I would assume I can modify it to get the indices in bold black but I fail to do this. Can you help please?
for i = 1:length(main_trough_location)
index = all_trough_location > main_trough_location(i);
end_location(counter) = all_trough_location(find(index,1));
end_value(counter) = all_trough_value(find(index, 1));
h = legend('signal',' all troughs','main troughs','end');