current c and matlab code