Finding the nearest value to a specifics numbers in a table
Show older comments
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
Adam Danz
on 22 Oct 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.
Answers (0)
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!