Finding the nearest value to a specifics numbers in a table

Hi, I have a table with dimensions of metal profiles and I programmed the design of metal pillars using genetic algorithm. So, the genetic algorithm finds the effective values of profile dimensions, but the dimensions found are not in the table. So, I want to find the profile with dimensions closer to the dimensions found by the algorithm, using the table.

1 Comment

If the differences are small, you could use LIA = ismembertol(A,B,tol) which identfies the value in A that are within tolerance (tol) to B.
Otherwise you could use a combination of abs(), min() and subtraction to find the values with the smallest difference.

Sign in to comment.

Answers (0)

Asked:

on 22 Oct 2020

Commented:

on 22 Oct 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!