matlab三个自变量,第四维(三个变量的函数)大小用颜色表示

2024-12-22 18:29:40
推荐回答(1个)
回答1:

用scatter3。具体请看一下该函数的帮助,举的例子就是类似的用途,如下: [x,y,z] = sphere(16);X = [x(:)*.5 x(:)*.75 x(:)];Y = [y(:)*.5 y(:)*.75 y(:)];Z = [z(:)*.5 z(:)*.75 z(:)];S = repmat([1 .75 .5]*10,prod(size(x)),1);C = repmat([1 2 3],prod(size(x)),1);scatter3(X(:),Y(:),Z(:),S(:),C(:),'filled'), view(-60,60)