How do you use the slice function with color?

1 view (last 30 days)
I have a 3x3x3 matrix and I want it to correspond to the color of each square, yet rather than producing a 3x3x3 cube, a 2x2x2 cube is generated. Here is my code:
colormap jet
xslice = 10; yslice = 10; zslice = [0.1 1 10];
slice([0.1 1 10], [0.1 1 10], [0.1 1 10], my_map(:,:,:,1), xslice, yslice, zslice);
ax = gca; ax.XScale = 'log'; ax.YScale = 'log'; ax.ZScale = 'log';
colorbar;

Answers (0)

Categories

Find more on Contour Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!