体积切片图出错了

时间:2017-07-19 16:59:57

标签: matlab plot 3d matlab-figure

这是我的代码:

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)等等,是我想要切割图的点。但是,我得到了这个结果:

wrong

为什么会这样出现?我希望它看起来像the first one here

1 个答案:

答案 0 :(得分:0)

当我跑步时:

% 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);

我得到这样的东西:

enter image description here

这对我来说很好看。尝试查看您的bestcoefsccno是否正确定义。