Less For, more MATLABesque?
With this random data and a few tweeks I got the time reduced about 30 times. The inner loop can be taken outside which is the biggest difference.

clear all

n=800;
data = randn(2,n,30);
times=linspace(-1900,8600,n);

tic;

samplingrate = 200;
scalefac = 1000/samplingrate;

brainchannel = 12;  % channel # for brain data
heartchannel = 62;  % channel # for heart data

brainchannel = 1;
heartchannel = 2; %adjusted for test data

brainbin = 10;      % bin length for brain data (symmetric, in msec)
heartbin = 250;     % bin length for heart data (= 500 msec window)

heart = 5500;       % max point (from zero, in msec) for heart data
brain = 2500;       % max point (from zero, in msec) for brain data
first = -500;       % first point (from zero, in msec)


xvec=find(times&gt;first,1):find(times&gt;brain,1);
yvec=find(times&gt;first,1):find(times&gt;heart,1);

CECT=zeros(length(xvec),length(yvec));  %initialize

braindata=squeeze(data(brainchannel,(xvec(1)-heartbin/scalefac):(xvec(end)+brainbin/scalefac),:));
bn=length((xvec(1)-brainbin/scalefac):(xvec(1)+brainbin/scalefac));

heartdata=squeeze(data(heartchannel,(yvec(1)-heartbin/scalefac):(yvec(end)+heartbin/scalefac),:));
hn=length((yvec(1)-heartbin/scalefac):(yvec(1)+heartbin/scalefac));
hps=zeros(length(yvec),size(data,3));

p=1;
for y = yvec
    hps(p,:) = mean(heartdata(p:p-1+hn,:),1);
    p = p+1;    % counter for looping over heart data
end

yy = 1;             % counter for looping over brain data
for x = xvec
    eeg = mean(braindata(yy:yy-1+bn,:),1);
    CECT(yy,:) = corr(squeeze(eeg).',hps.');
    %%CECT(yy,:) = eeg * hps.'; %for testing
    yy = yy+1;
end

toc