体积切片图出错

volumetric slice plot gone wrong

这是我的代码:

xslice = [bestcoefs(1), cc1(no1)]; 
yslice = [bestcoefs(2), cc2(no2)];
zslice = [cc3(1), bestcoefs(3)]; 
slice(V, xslice, yslice, zslice, 'linear');
cb = colorbar; 
xlabel('c1'); ylabel('c2'); zlabel({'likelihood of (c1,c2,c3)','c3'});
view(3);

V 是概率矩阵 6x13x9 和 bestcoefs(1)cc1(no1) 等是我想要分割情节的点。但是,我得到了这个结果:

为什么会变成这样?我希望它看起来像 the first one here.

当我运行:

% some data:
V = randn(6,13,9);
bestcoefs = randi(6,3,1);
cc = randi(6,3,1);

% your code with slight modifications:
xslice = [bestcoefs(1), cc(1)]; 
yslice = [bestcoefs(2), cc(2)];
zslice = [cc(1), bestcoefs(3)]; 
slice(V, xslice, yslice, zslice, 'linear');
cb = colorbar; 
xlabel('c1'); ylabel('c2');...
    zlabel({'likelihood of (c1,c2,c3)','c3'});
view(3);

我得到这样的结果:

我觉得不错。尝试查看您的 bestcoefsccno 是否定义正确。