Dynamic programming

Longest common subsequence in matlab

The following Matlab project contains the source code and Matlab examples used for longest common subsequence. %%%INPUT %%%X, Y - both are strings e.g. 'test' or 'stingtocompare' %%%OUTPUT %%%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)

Knapsack problem in matlab

The following Matlab project contains the source code and Matlab examples used for knapsack problem. The knapsack problem or rucksack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a value, determine the count of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.

Dynamic time warping in matlab

The following Matlab project contains the source code and Matlab examples used for dynamic time warping. If you pass in 2 vectors it returns the unnormalized distance between the vectors, the accumulated distance between them, the length of the warping path (the normalizing factor), and the warping path points.
Subscribe to RSS - Dynamic programming