Hello,
I have different variables (date, time, lat, lon) and X for different depths, where each column represents n times (number of different depths) the same variable at a different depth, let say 0 m, 100 m, 500 m. Here a more explicit example :
A = [20200101, NaN, NaN, 1200, NaN, NaN, 90, NaN, NaN, 45, NaN, NaN, 2, NaN, NaN;
NaN, 20200101, NaN, NaN, 1200, NaN, NaN, 90, NaN, NaN, 45, NaN, NaN, 3, NaN;
NaN, NaN, 20200101, NaN, NaN, 1200, NaN, NaN, 90, NaN, NaN, 45, NaN, NaN, 4 ];
How can I keep the repeated band combinations for date, time, latitude and longitude, so my final output would be, for each unique Date / Time / Lat / Lon :
B = [20200101, 1200, 90, 45, 2, 3, 4];
I was thinking of using a for loop with find
find(A(i,1)==A(:,2) & A(i,1)==A(:,3) etc.)
But I if I have 50 different depths, it will be a lot of combinations. Does anyone has a simpler way in mind ?
Cheers
1 Comment
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/506844-row-combination-for-repeated-values#comment_800569
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/506844-row-combination-for-repeated-values#comment_800569
Sign in to comment.