I want fo find time and index when current is 90% of peak value during rise and fall.
Its easy to find rise but during fall, current drop quickly and there is no data point/index available at 90% of peak value.
How can I get index and time at 90% fall/drop value? probably by extrapolation or data fiting. please help.
Thanks
A1= load('data.txt');
T=A1(:,1); %Time
I=A1(:,2); %Current
[Imx,iImx]=max(I); %locate peak value and index in current
i90=find(I>=Imx*0.9,1,'first'); % First 90% of Peak during rise.
ii90=find(I>=Imx*0.9,1,'last'); % Last/second 90% of peak during fall
T90R=T(i90);
T90F=T(ii90);
plot(T,I,'.'); hold on
plot(T(i90),I(i90),'bs','LineWidth',2 ,'MarkerSize',6)
plot(T(i90),I(i90),'bs','LineWidth',2 ,'MarkerSize',6)
hold off
Best Answer