MATLAB: Min value & correlating time from two different matrices

min valuetwo matrices

I have a 91×2 matrix, the first column is time the second is kinematic data of knee angles. I need to find the maximum knee flexion and save the time and angle separately for graphing. Any suggestions? I know how to find the maximum knee angle by using min (They're negative angles) but how do I get the correlating times?

Best Answer

Ask min for its second output, the index of the minimum value:
Example:
t = linspace(pi,2*pi,91);
y = sin(t);
data = [t' y'];
[minangl,idx] = min(data(:,2),[],1);
out = [t(idx) minangl]
produces:
out =
4.7124e+000 -1.0000e+000