Mercurial > hg > map
comparison 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 |
comparison
equal
deleted
inserted
replaced
37:771a643d5c29 | 38:c2204b18f4a2 |
---|---|
1 function UTIL_cascadePlot(toPlot, colValues) | |
2 % % useful code | |
3 [nChannels nLags]=size(toPlot); | |
4 | |
5 % cunning code to represent channels as parallel lines | |
6 [nRows nCols]=size(toPlot); | |
7 if nChannels<2 | |
8 error('UTIL_cascadePlot: only one row found') | |
9 end | |
10 | |
11 % a is the height to be added to each channel | |
12 a=max(max(toPlot))*(0:nRows-1)'; | |
13 | |
14 % peakGain emphasises the peak height | |
15 % peaks can be higher than the space between channels | |
16 peakGain=10; | |
17 x=peakGain*toPlot+repmat(a,1,nCols); | |
18 x=nRows*x/max(max(x)); | |
19 | |
20 for row=1:nRows-1 | |
21 x(row,:)=min(x(row,:), x(row+1,:)); | |
22 end | |
23 | |
24 plot(colValues, x','k') | |
25 ylim([0 nRows]) | |
26 |