Update dp_tseg_c.m

Fix bug, previous cache check is not correct