% generate spike times: rate = 20.0; spikes = hompoissonspikes( 10, rate, 50.0 ); % isi histogram: isivec = isis( spikes ); isihist( isivec ); hold on % theoretical density: xmax = 5.0/rate; x = 0:0.0001:xmax; y = rate*exp(-rate*x); plot( 1000.0*x, y, 'r', 'LineWidth', 3 ); % plot details: title( sprintf( 'Poisson spike trains, rate=%g Hz, nisi=%d', rate, length( isivec ) ) ) xlim( [ 0.0 1000.0*xmax ] ) ylim( [ 0.0 1.1*rate ] ) legend( 'data', 'poisson' ) hold off