In order to use samplealign
function with sparse data in Matlab, we must provide our data in a sparse matrix format. The format of sparse(i, j, s)
function can be used to create a sparse matrix, where i
and j
are the pairs of indices that have non-zero entries, and s
is the corresponding values.
Here is a simple example:
main.m238 chars7 lines
Alternatively, we can read a sparse matrix from a file using the mmread
function from the Matrix Market Matlab toolbox. Here is an example:
main.m180 chars8 lines
Once we have computed the cost matrix using samplealign
, we can apply different algorithms to perform alignment on this cost matrix, such as hungarian
, munkres
, greedy
, etc.
main.m87 chars3 lines
gistlibby LogSnag