I was thinking of a question similar to this.
I have a function which takes as input the three values x,y,z from the R^3 and returns either 1,2,3,4. Now I wanted to plot the point in the 3D space with coordinates (x,y,z) with a color associated with the functional value at that point which can be either one of 1,2,3 or 4.
I have a 3D matrix with integer entries like say 1,2,3,4 and I store the points value in this matrix so that I can plot the points with the corresponding color (similar trick of 'image' command in MATLAB for making 2D plots).
color coding (say)-
1 - green, 2 - blue , 3 - cyan , 4 -red
Like if at the point (0.5,0.5,0.1) the function returns the value 3, then I mark the point (0.5,0.5,0.1) with the color associated to number three which is cyan.
I am thinking of a MATLAB command which does this in the case of three dimensional case as the "image" command seems to work for the 2D case.
