rmeddis@38: function UTIL_cascadePlot(toPlot, colValues) rmeddis@38: % % useful code rmeddis@38: [nChannels nLags]=size(toPlot); rmeddis@38: rmeddis@38: % cunning code to represent channels as parallel lines rmeddis@38: [nRows nCols]=size(toPlot); rmeddis@38: if nChannels<2 rmeddis@38: error('UTIL_cascadePlot: only one row found') rmeddis@38: end rmeddis@38: rmeddis@38: % a is the height to be added to each channel rmeddis@38: a=max(max(toPlot))*(0:nRows-1)'; rmeddis@38: rmeddis@38: % peakGain emphasises the peak height rmeddis@38: % peaks can be higher than the space between channels rmeddis@38: peakGain=10; rmeddis@38: x=peakGain*toPlot+repmat(a,1,nCols); rmeddis@38: x=nRows*x/max(max(x)); rmeddis@38: rmeddis@38: for row=1:nRows-1 rmeddis@38: x(row,:)=min(x(row,:), x(row+1,:)); rmeddis@38: end rmeddis@38: rmeddis@38: plot(colValues, x','k') rmeddis@38: ylim([0 nRows]) rmeddis@38: