求助如何输出结构体(strucut)中的元素
N = 4; dag = zeros(N,N);
%C = 1; S = 2; R = 3; W = 4;
C = 4; S = 2; R = 3; W = 1;
% arbitrary order
dag(C,[R S]) = 1;
dag(R,W) = 1;
dag(S,W)=1;
false = 1; true = 2;
ns = 2*ones(1,N);
bnet = mk_bnet(dag, ns);
bnet.CPD{C} = tabular_CPD(bnet, C,'CPT', [0.5 0.5]);
bnet.CPD{R} = tabular_CPD(bnet, R, 'CPT',[0.8 0.2 0.2 0.8]);
bnet.CPD{S} = tabular_CPD(bnet, S, 'CPT',[0.5 0.9 0.5 0.1]);
bnet.CPD{W} = tabular_CPD(bnet, W, 'CPT',[1 0.1 0.1 0.01 0 0.9 0.9 0.99]);
bnet是一个结构体
我想吧条件概率表CPT给输出来
即以第一个为例得到CPT:0.5 0.5