How can I plot columnar grains?

I have a cube of 30x30x30 small cubes. Each cube will be called element. How can I plot something like the following image? This RVE has columnar grains with each grain being different in color. No element will share two grains.
Thanks!

Answers (1)

Image Analyst
Image Analyst on 29 Sep 2023
Edited: Image Analyst on 1 Oct 2023
Perhaps the Volume Viewer app on the Apps tab of the tool ribbon.

Categories

Asked:

on 28 Sep 2023

Edited:

on 1 Oct 2023

Community Treasure Hunt

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

Start Hunting!