Documentation of corr_indices


Global Index (short | long) | Local contents | Local Index (short | long)


Help text

tim = 101:550;

Cross-Reference Information

This script calls

Listing of script corr_indices


clear
tim = 551:1000;

ct = getheat(1:3, tim, [170 280 -5 5]);
wstp = getheat(1:3, tim, [125 145 7.5 20]);
ml = getheat(1:3, tim, [180 205 25 42.5]);

ct = squeeze(mean2(mean2(shiftdim(ct, 1))));
wstp = squeeze(mean2(mean2(shiftdim(wstp, 1))));
ml = squeeze(mean2(mean2(shiftdim(ml, 1))));

ct = detrend(ct);
wstp = detrend(wstp);
ml = detrend(ml);

[b, a] = butter(6, 2/8);
ct = filtfilt(b, a, ct);
wstp = filtfilt(b, a, wstp);
ml = filtfilt(b, a, ml);

lags = -30:30;
for i = 1:length(lags);
  ctct(i) = corr(ct, ct, lags(i));
  ctml(i) = corr(ct, ml, lags(i));
  ctwstp(i) = corr(ct, wstp, lags(i));
  mlwstp(i) = corr(ml, wstp, lags(i));
end

figure(2); figure_orient;
subplot(4,1,1);
  bar(lags, ctct);
  title('< CT, CT >')
  axis([-32 32 -1 1])
  set(gca, 'YTick', -1:.2:1);
  set(gca, 'XTick', -40:5:40);
  grid on
subplot(4,1,2);
  bar(lags, ctml);
  title('< CT, ML >')
  axis([-32 32 -1 1])
  set(gca, 'YTick', -1:.2:1);
  set(gca, 'XTick', -40:5:40);
  grid on
subplot(4,1,3);
  bar(lags, ctwstp);
  title('< CT, WSTP >')
  axis([-32 32 -1 1])
  set(gca, 'YTick', -1:.2:1);
  set(gca, 'XTick', -40:5:40);
  grid on
subplot(4,1,4);
  bar(lags, mlwstp);
  title('< ML, WSTP >')
  axis([-32 32 -1 1])
  set(gca, 'YTick', -1:.2:1);
  set(gca, 'XTick', -40:5:40);
  grid on