Try this:
a=[1 0 3;1 1 4;1 2 4;1 3 5]
x=a(:,1);
y=a(:,2);
z=a(:,3);
L1 = (z > 1) & (z <= 3);
L2 = (z > 3) & (z <= 5);
figure(1)
scatter3(x(L1), y(L1), z(L1), 'rp')
hold on
scatter3(x(L2), y(L2), z(L2), 'bp')
hold off
grid on
Change the conditions as necessary for your data.
Best Answer