findout missing values in between a contenous matrix
5 views (last 30 days)
Geoff Hayes on 17 May 2015
navan - if you are just trying to find the missing elements of A if 1 is the minimum value and 20 is the maximum value, then you could do something like
A = [1,2,3,4,7,8,11,14,16,19,20];
minVal = min(A);
maxVal = max(A);
missedValues = setdiff(minVal:maxVal,A);
We use the setdiff function to determine which elements that are in the array defined by minVal:maxVal are not in A.
Try the above and see what happens!