Function fzsearch(r,p,n,case) finds the best or predetermined approximate matching between substrings of a string r (reference) and a string p (pattern). The Levenshtein distance is used as a measure of matching. Levenshtein distance is the minimum number of single-character substitutions, deletions and insertions required to convert string A to string B. It is possible to search both for case sensitive and insensitive.
Results of a search are a distance of matching and indices of the ends of reference substrings. For the best match, the function allows to determine also the substrings themselves.
Eduard Polityko (2020). Fuzzy Search (https://www.mathworks.com/matlabcentral/fileexchange/66271-fuzzy-search), MATLAB Central File Exchange. Retrieved .
The function is not intended for cells, but only for strings (see description). It would probably be reasonable to provide an error message when using cells.
Thank you for your attention and high rating.
Hi Eduard, the function is really great. I am signaling that when the function is with a cell array, like the following:
a is a cell array of 10 elements instead of 2. All the elements from 2 to 5 and from 7 to ten are empty.