% plot transients of Ca, IP3, IP3Ropen, IP3Rinh, and CaStore

clear

file_head = 'CFat'
Caextention = 'msec_Ca.plot'

% Including GENESIS plot files to MATLAB

for i = 1:13
    dt = i * 50 - 250
    CaFileFullName = strcat(file_head, int2str(dt), Caextention);
    Catmp = load(CaFileFullName);
    Ca(:,i) = Catmp(:,2) - (i * 5) + 70 ;
end

% plot Ca
plot(-250:600,Ca(251:1101, 1), -200:600,Ca(301:1101, 2), -150:600,Ca(351:1101, 3), -100:600,Ca(401:1101, 4), ...
      -50:600,Ca(451:1101, 5),  -50:650,Ca(451:1151, 6),  -50:700,Ca(451:1201, 7),  -50:750,Ca(451:1251, 8), ...
      -50:800,Ca(451:1301, 9),  -50:850,Ca(451:1351,10),  -50:900,Ca(451:1401,11),  -50:950,Ca(451:1451,12),  -50:999,Ca(451:1500,13))
axis([-500 1000 0 70])
set(gca,'xtick',[-500 -400 -300 -200 -100 0 100 200 300 400 500 600 700 800 900 1000])
set(gca,'ytick',[0 5 10 15 20 25 30 35 40 45 50 55 60 65 70])
xlabel('Time (ms)')
ylabel('[Ca2+] (\muM)')