[f949a5]: / theonewith_voxels.asv

Download this file

19 lines (14 with data), 413 Bytes

clear all; close all; clc;

% numbers are arbitrary
cube=zeros(11,11,11);
cube(3:9,3:9,3:9)=5; % Create a cube inside the region

% Boring: faces of the cube are a different color.
cube(3:9,3:9,3)=2;
cube(3:9,3:9,9)=2;
cube(3:9,3,3:9)=2;
cube(3:9,9,3:9)=2;
cube(3,3:9,3:9)=2;
cube(9,3:9,3:9)=2;

H=vol3d('Cdata',cube,'alpha',cube/5) %what is alpha?
figure;
plot3(H.cdata(:,:),H.cdata,H.cdata);