Hello,
I have flipped this time series data using flipud and have found the value of 5% of the second to last peak. I want to flip this data back to its original position and figure out the x value that goes with the y value I found earlier. Does anyone know how I can do this?
for k = 1:15 % number of pages
clear pks locs indx threshv df Starts
df = (ButteryFilter(cutoff,samp_freq,abs(derivative(:,1,k))));
[pks,locs] = findpeaks(df,'minpeakprominence',0.01);
threshv = 0.05*abs(pks(end-1)); % 2nd to last peak is first movement
z = locs(end-1) % time of second to last peak
indx=find(df(z:10000)<threshv); % starting from 2nd to last pk, find 5 percent
Starts=indx(1,1) + z;
% find the y point of the index so i can flip and find right time
Start_RT(end+1)= Starts(1,1);
Sub_RT{end+1} = (Start_RT(:,k)) - (target_solutions{:,k}); % reaction time calculation
% RT_Unflipped = flipud(RT_FlipIt)
end
(I am interested in knowing at what time 5% of the value of the second to last peak occurs. I have to unflip this so that the time in ms is correct, the second to last peak is actually the second peak when unflipped)