diff options
| author | ziejd2 | 2017-09-28 15:04:40 -0500 |
|---|---|---|
| committer | ziejd2 | 2017-09-28 15:04:40 -0500 |
| commit | 8070dc963753142bb86c4ed698d91fd623ed28e7 (patch) | |
| tree | d0f6dd8fc46a49b819aa55c1a90faa14d8448883 /sourcecodes/bnt-master/BNT/examples/dynamic/HHMM/Square/plot_square_hhmm.m | |
| parent | 7cc31810d53176e805532b2789955f4eedbce6bb (diff) | |
| download | BNW-8070dc963753142bb86c4ed698d91fd623ed28e7.tar.gz | |
BNW using Octave instead of Matlab.
This version of BNW should perform the same as the original version. The only difference is that it uses Octave instead of Matlab when running BayesNet Toolbox during parameter learning. I am calling this BNW_1.02. It can be accessed at: compbio.uthsc.edu/BNW_1.02
Diffstat (limited to 'sourcecodes/bnt-master/BNT/examples/dynamic/HHMM/Square/plot_square_hhmm.m')
| -rw-r--r-- | sourcecodes/bnt-master/BNT/examples/dynamic/HHMM/Square/plot_square_hhmm.m | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/BNT/examples/dynamic/HHMM/Square/plot_square_hhmm.m b/sourcecodes/bnt-master/BNT/examples/dynamic/HHMM/Square/plot_square_hhmm.m new file mode 100644 index 00000000..e61e5669 --- /dev/null +++ b/sourcecodes/bnt-master/BNT/examples/dynamic/HHMM/Square/plot_square_hhmm.m @@ -0,0 +1,27 @@ +function plot_square_hhmm(ev) +% Plot the square shape implicit in the evidence. +% ev{i,t} is the value of node i in slice t. +% The observed node contains a velocity (delta increment), which is converted +% into a position. +% The Q2 node specifies which model is used, and hence which color +% to use: 1=red, 2=green, 3=blue, 4=black. + +Q1 = 1; Q2 = 2; Q3 = 3; F3 = 4; F2 = 5; Onode = 6; + +delta = cell2num(ev(Onode,:)); % delta(:,t) +Q2label = cell2num(ev(Q2,:)); + +T = size(delta, 2); +pos = zeros(2,T+1); +hold on +cols = {'r', 'g', 'b', 'k'}; +for t=2:T+1 + pos(:,t) = pos(:,t-1) + delta(:,t-1); + plot(pos(1,t), pos(2,t), sprintf('%c.', cols{Q2label(t-1)})); + if (t==2) + text(pos(1,t-1),pos(2,t-1),sprintf('%d',t)) + elseif (mod(t,20)==0) + text(pos(1,t),pos(2,t),sprintf('%d',t)) + end +end + |
