diff utilities/UTIL_cascadePlot.m @ 38:c2204b18f4a2 tip

End nov big change
author Ray Meddis <rmeddis@essex.ac.uk>
date Mon, 28 Nov 2011 13:34:28 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/utilities/UTIL_cascadePlot.m	Mon Nov 28 13:34:28 2011 +0000
@@ -0,0 +1,26 @@
+function UTIL_cascadePlot(toPlot, colValues)
+% % useful code
+[nChannels nLags]=size(toPlot);
+
+% cunning code to represent channels as parallel lines
+[nRows nCols]=size(toPlot);
+if nChannels<2
+    error('UTIL_cascadePlot: only one row found')
+end
+
+% a is the height to be added to each channel
+a=max(max(toPlot))*(0:nRows-1)';
+
+% peakGain emphasises the peak height
+% peaks can be higher than the space between channels
+peakGain=10;
+x=peakGain*toPlot+repmat(a,1,nCols);
+x=nRows*x/max(max(x));
+
+for row=1:nRows-1
+    x(row,:)=min(x(row,:), x(row+1,:));
+end
+
+plot(colValues,   x','k')
+ylim([0 nRows])
+