Computer Programs

8.1 Edit distance. Write a MATLAB function named edit_distance that computes the Edit distance between two strings. This function takes as inputs (a) the reference string ref_str and (b) the test string test_str. It returns (a) the matching cost edit_cost and (b) the node predecessors matrix pred. Each element of the last matrix stores the coordinates of the predecessor of a node as a complex number, the real part of which stands for the row index and the imaginary part for the column index.

Solution

In the following implementation it is assumed that the reference pattern is associated with the horizontal axis.

8.2. Backtracking ...

Get Pattern Recognition, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.