How can I analyze the time complexity of this Dynamic Time Warping algorithm implemented in MATLAB?
Look at the main double for loop that does all the work. It loops for m from 2 to M and then inside that for n from 2 to N. This is O(MN) like you expected.