w=[randi(2,50,1),randi(3,50,1),randi(5,50,1)];
x=repmat((1:10)',5,1);
y=repmat((1:3:15)',10,1);
z=[ones(10,1);ones(10,1)+1;ones(10,1)+2;ones(10,1)+3;ones(10,1)+4];
p=rand(50,1)*75;
c=w(:,1);
cVals=unique(c);
for i=1:length(cVals)
indices=find(c==cVals(i));
scatter3(x(indices),y(indices),z(indices),p(indices),'filled');
hold on
end
c=w(:,2);
cVals=unique(c);
for i=1:length(cVals)
indices=find(c==cVals(i));
scatter3(x(indices),y(indices),z(indices),p(indices),'filled');
hold on
end
c=w(:,3);
cVals=unique(c);
for i=1:length(cVals)
indices=find(c==cVals(i));
scatter3(x(indices),y(indices),z(indices),p(indices),'filled');
hold on
end