I have function which plots some 3D figure with
scatter3(mx,my,mz,3,mx.^2+my.^2); % mx, my and mz are vectors
I see that C is a vector the same length as X and Y, so color of each point should be linearly mapped to the colors in the current colormap, per documentation.
I tried this:
cmap = colormap;
disp(cmap(mx.^2+my.^2));
but I am getting
Subscript indices must either be real positive integers or logicals.
Is there any easier way to solve this quest?
Thanks