lcs

Longest (maximum) common subsequence

Contents

Syntax

Description

lcsLength = lcs(a, b) returns the LCS (longest common subsequence) between two strings a and b.

lcsLength = lcs(a, b, 1) plots the path of LCS.

[lcsLength, lcsPath, lcsStr, lcsTable] = lcs(a, b) returns extra info:

Example

str1='elimination';
str2='religious';
showPlot=1;
[lcsLength, lcsPath, lcsStr, lcsTable] = lcs(str1, str2, showPlot);

See Also

editDistance, dpPathPlot4strMatch.


Top page   Next: knncWrtK.m   Prev:lda.m