Assuming you have the data for the h-reflex and m-wave in two separate arrays h_reflex
and m_wave
, you can find the maximum value of the m-wave using the max
function in MATLAB. Here is an example script to determine the max value and its corresponding index:
main.m293 chars9 lines
You can use the above script to get the max m-wave value and index. To get the points of cancellation, you would need to define a 'cancellation threshold' value and identify the indices where the m-wave value falls below that threshold, and use that index to identify the corresponding point in the h-reflex array. Here is an example script to accomplish that:
main.m727 chars24 lines
In the above example script, we first define a cancellation threshold (50% of max m-wave value). We then find the indices where the m-wave value falls below the cancellation threshold and store those in a matrix called cancellation_indices
. We then use these indices to extract the corresponding h-reflex values and print them.
gistlibby LogSnag