www.gusucode.com > MC-CDMA系统的仿真matlab源码程序 > mc-cdma/err.m
function ber=err(datatx,datarx,totalwords,numusers) errs=totalwords*numusers; for i=1:totalwords*numusers, if datatx(i)==datarx(i), errs=errs-1; end; end; ber=errs/(totalwords*numusers);