matlab code about ccn