annotate toolboxes/FullBNT-1.0.7/bnt/potentials/@upot/upot.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function pot = upot(domain, sizes, p, u)
Daniel@0 2 % UPOT Make a discrete utility potential.
Daniel@0 3 % pot = upot(domain, sizes, p, u)
Daniel@0 4 %
Daniel@0 5 % sizes(i) is the size of the i'th domain element.
Daniel@0 6 % p defaults to all 1s, u defaults to all 0s.
Daniel@0 7
Daniel@0 8 if nargin < 3, p = myones(sizes); end
Daniel@0 9 if nargin < 4, u = 0*myones(sizes); end
Daniel@0 10
Daniel@0 11 pot.domain = domain;
Daniel@0 12 pot.p = myreshape(p, sizes);
Daniel@0 13 pot.u = myreshape(u, sizes);
Daniel@0 14 pot.sizes = sizes(:)';
Daniel@0 15 pot = class(pot, 'upot');