To determine the points where cancellation occurs in Matlab, you need to analyze your data and detect the points where the signs change. Here's a simple way to do it:
load
function.sign
function, which returns -1, 0 or 1 depending on the sign of the input.diff
function.find
function.Here's the code to implement these steps:
main.m153 chars9 lines
The idx
vector contains the indices of the points where the signs of the data change, i.e. where cancellation occurs.
gistlibby LogSnag