comparison toolboxes/FullBNT-1.0.7/netlab3.3/plotmat.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function plotmat(matrix, textcolour, gridcolour, fontsize)
2 %PLOTMAT Display a matrix.
3 %
4 % Description
5 % PLOTMAT(MATRIX, TEXTCOLOUR, GRIDCOLOUR, FONTSIZE) displays the matrix
6 % MATRIX on the current figure. The TEXTCOLOUR and GRIDCOLOUR
7 % arguments control the colours of the numbers and grid labels
8 % respectively and should follow the usual Matlab specification. The
9 % parameter FONTSIZE should be an integer.
10 %
11 % See also
12 % CONFFIG, DEMMLP2
13 %
14
15 % Copyright (c) Ian T Nabney (1996-2001)
16
17 [m,n]=size(matrix);
18 for rowCnt=1:m,
19 for colCnt=1:n,
20 numberString=num2str(matrix(rowCnt,colCnt));
21 text(colCnt-.5,m-rowCnt+.5,numberString, ...
22 'HorizontalAlignment','center', ...
23 'Color', textcolour, ...
24 'FontWeight','bold', ...
25 'FontSize', fontsize);
26 end;
27 end;
28
29 set(gca,'Box','on', ...
30 'Visible','on', ...
31 'xLim',[0 n], ...
32 'xGrid','on', ...
33 'xTickLabel',[], ...
34 'xTick',0:n, ...
35 'yGrid','on', ...
36 'yLim',[0 m], ...
37 'yTickLabel',[], ...
38 'yTick',0:m, ...
39 'DataAspectRatio',[1, 1, 1], ...
40 'GridLineStyle',':', ...
41 'LineWidth',3, ...
42 'XColor',gridcolour, ...
43 'YColor',gridcolour);
44