add matlab code for the result calculation