My goal is to compare which came first, the max value or minimum value, I use bsxfun() to find which index came first(max or min). But now I want to subtract the max or min value from each other, depending on which one came first.
So say max came first, so max value came before min value in this column, Now subtract max value from min value givin we know where they are located bc of indexs.
But im having trouble using the boolean logic to generate this form using bsxfun(), any ideas?
So with this:
[max_value1 max_index1] = max(data1);
[max_value2 max_index2] = max(data2);
[min_value1 min_index1] = min(data1);
[min_value2 min_index2] = min(data2);
comInput1 = bsxfun(@lt, max_index1, min_index1);
comInput2 = bsxfun(@lt, max_index2, min_index2);