If I understood your question correctly, I would propose the following:
First, find the places where 1 changes to 10 or 10 to 1. The easiest way to do this is to diff the column(find differences between the rows). Then you can use logical indexing to extract out the right values from your depth data. Once you have the two sets of depth data, you can just subtract them.
See code below:
SRAMi = zeros(10,6);
SRAMi(:,1) = [1 1 10 10 10 10 10 1 1 1];
SRAMi(:,3) = [1 1 1 1 10 10 10 10 1 1];
MD = [1070 1071 1074 1075 1076.1 1078 1080 1085 1087 1090];
diff1 = [0; abs(diff(SRAMi(:,1)))];
diff3 = [0; abs(diff(SRAMi(:,3)))];
depth1 = MD(diff1 == 9);
depth3 = MD(diff3 == 9);
diffdepth = depth3 - depth1;
Logical indexing is probably the trickiest thing to understand here. If you are interested in reading more about it, see link below.
Best Answer