Hi all,
I generated an index based on the depth position in which one sensor changes the direction at the water column, from upward to downward (Code below). My idea is to apply this index to locate the position of the MAXIMUM density between each index. For example, I would like to know the position of MAXIMUM density from index 1:ind(1), ind(1):ind(2), ind(2):ind(3)… The index interval are not regular and I am processing a 400810×1 size data. The figure below illustrate what I am planning to obtain, the values in red are the maximum differences in each group and I am interested to obtain the "Position" of the same. The position will work as index to continue the data processing.
Thank you for your time,
%Locating the position of change in direction based on depth differences
ind_change_direc=nan(size(depth_diff));for i=1:length(depth_diff)-1 if depth_diff(i)<0 & depth_diff(i+1)>0; ind_change_direc(i)=-9999; endendindex=ind_change_direc==-9999;
Best Answer