I'm trying to draw 2 cubes in one M file. This is my code:
format compact h(1) = axes('Position',[0.2 0.2 0.6 0.6]); vert = [1 1 1; 1 2 1; 2 2 1; 2 1 1 ; ... 1 1 2;1 2 2; 2 2 2;2 1 2]; fac = [1 2 3 4; ... 2 6 7 3; ... 4 3 7 8; ... 1 5 8 4; ... 1 2 6 5; ... 5 6 7 8]; patch('Faces',fac,'Vertices',vert,'FaceColor','r'); % patch function material shiny; alpha('color'); alphamap('rampdown'); view(30,30);
Now, I want to draw second cube and replace inside first one. Does anyone know how I can do that?