Finding the nearest value to a specifics numbers in a table

8 visualizaciones (últimos 30 días)
Igor Moura
Igor Moura el 22 de Oct. de 2020
Comentada: Adam Danz el 22 de Oct. de 2020
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 comentario
Adam Danz
Adam Danz el 22 de Oct. de 2020
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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Genetic Algorithm en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by