avgPerFrame.m 758 B

123456789101112131415161718
  1. function [membranPotAVG]=avgPerFrame ...
  2. (membranePot,ttls_ms)
  3. %function [membranPotAVG]=avgPerFrame ...
  4. % (membranePot,ttls_ms)
  5. %builds the average membrane potential between frames for the white noise
  6. % -> same principle for frozen frames
  7. % INPUT: membranePot -> membrane Potential
  8. % ttls_ms -> pulses in ms
  9. % OUTPUT: membranPotAVG -> average membrane potential per frames
  10. membranPotAVG=zeros(1,length(ttls_ms)-1);%preallocate
  11. %make the average membrane potential between two stimulus frames
  12. for jj=1:length(ttls_ms)-1
  13. membranPotAVG(jj)=mean(membranePot(ttls_ms(jj) ...
  14. :(ttls_ms(jj+1)-1)));%detail: -1ms because the next ms is already the start of the new stimulus frame
  15. end
  16. end