Determine row vector out of matrix with most evenly spaced and distributed values
I have calculated results in a matrix with 100×20 values. Now I want to find the one row vector out of this matrix where the values (2:19) are most evenly spaced between these two boundary values (2) and (19). First and last value of the row don’t need to be considered. Boundary values are different per each row, but in a similar range. Rows are already sorted.
Example with less values:
M(2,2:8) = [2.1 2.5 2.9 3.2 3.5 3.7 5.8 8.9] would be a bad one
M(20,2:8) = [2.0 2.9 3.7 4.4 5.3 6.2 7.0 7.9] would be a better one
Does someone have a good idea, how to do that?I have calculated results in a matrix with 100×20 values. Now I want to find the one row vector out of this matrix where the values (2:19) are most evenly spaced between these two boundary values (2) and (19). First and last value of the row don’t need to be considered. Boundary values are different per each row, but in a similar range. Rows are already sorted.
Example with less values:
M(2,2:8) = [2.1 2.5 2.9 3.2 3.5 3.7 5.8 8.9] would be a bad one
M(20,2:8) = [2.0 2.9 3.7 4.4 5.3 6.2 7.0 7.9] would be a better one
Does someone have a good idea, how to do that? I have calculated results in a matrix with 100×20 values. Now I want to find the one row vector out of this matrix where the values (2:19) are most evenly spaced between these two boundary values (2) and (19). First and last value of the row don’t need to be considered. Boundary values are different per each row, but in a similar range. Rows are already sorted.
Example with less values:
M(2,2:8) = [2.1 2.5 2.9 3.2 3.5 3.7 5.8 8.9] would be a bad one
M(20,2:8) = [2.0 2.9 3.7 4.4 5.3 6.2 7.0 7.9] would be a better one
Does someone have a good idea, how to do that? matlab MATLAB Answers — New Questions