wolffd@0: Cell arrays are a little tricky in Matlab. wolffd@0: Consider this example. wolffd@0: wolffd@0: C=num2cell(rand(2,3)) wolffd@0: C = wolffd@0: [0.4565] [0.8214] [0.6154] wolffd@0: [0.0185] [0.4447] [0.7919] wolffd@0: wolffd@0: C{1,2} % this is the contents of this cell (could be a vector or a string) wolffd@0: ans = wolffd@0: 0.8214 wolffd@0: wolffd@0: C{1:2,2} % this is the contents of these cells - returns multiple wolffd@0: answers! wolffd@0: ans = wolffd@0: 0.8214 wolffd@0: ans = wolffd@0: 0.4447 wolffd@0: wolffd@0: A = C(1:2,2) % this is a slice of the cell array wolffd@0: ans = wolffd@0: [0.8214] wolffd@0: [0.4447] wolffd@0: wolffd@0: A{1} % A is itself a cell array wolffd@0: ans = wolffd@0: 0.8214 wolffd@0: wolffd@0: wolffd@0: wolffd@0: >> C(1:2,2)=0 % can't assign a scalar to a cell array wolffd@0: C(1:2,2)=0 wolffd@0: ??? Conversion to cell from double is not possible. wolffd@0: wolffd@0: wolffd@0: >> C(1:2,2)={0;0} % can assign a cell array to a cell array wolffd@0: C(1:2,2)={0;0} wolffd@0: C = wolffd@0: [0.4565] [0] [0.6154] wolffd@0: [0.0185] [0] [0.7919] wolffd@0: wolffd@0: wolffd@0: BTW, I use cell arrays for evidence for 2 reasons: wolffd@0: wolffd@0: 1. [] indicates missing values wolffd@0: 2. it can easily represent vector-valued nodes wolffd@0: wolffd@0: The following example makes this clear wolffd@0: wolffd@0: C{1,1} = [] wolffd@0: C{2,1} = rand(3,1) wolffd@0: wolffd@0: C = wolffd@0: [] [0] [0.6154] wolffd@0: [3x1 double] [0] [0.7919] wolffd@0: wolffd@0: wolffd@0: Hope this helps, wolffd@0: Kevin