image thumbnail

Longest Common Subsequence

version (1.68 KB) by David Cumin
Gives the longest common substring between two stings.


Updated 27 Jul 2011

View License

%%%X, Y - both are strings e.g. 'test' or 'stingtocompare'
%%%D is the substring over the length of the shortest string
%%%dist is the length of the substring
%%%aLongestString is a sting of length dist (only one of potentially many)

Cite As

David Cumin (2022). Longest Common Subsequence (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!