To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

The primary repository for this project is hosted at git://github.com/rmeddis/MAP.git .
This repository is a read-only copy which is updated automatically every hour.

Statistics Download as Zip
| Branch: | Revision:

root / utilities / UTIL_cascadePlot.m

History | View | Annotate | Download (599 Bytes)

1 38:c2204b18f4a2 rmeddis
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])