Calculate the DC and DRs use matlab