Using the patch function, create a black box with unit dimensions (so, there will be eight vertices and six faces). Set the edge color to white so that when you rotate the figure, you can see the edges
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:12| Question number:25.12
All Answers
total answers (1)
Ch12Ex25.m
% Draws a black box with unit dimensions
% set up the 8 vertices
polyhedron.vertices = [...
0 0 0
1 0 0
1 1 0
0 1 0
0 0 1
1 0 1
1 1 1
0 1 1];
% connect the 6 faces
polyhedron.faces = [...
1 2 3 4
5 6 7 8
1 2 6 5
1 4 8 5
2 3 7 6
3 4 8 7];
pobj = patch(polyhedron, ...
'FaceColor',[0 0 0],...
'EdgeColor','white');
need an explanation for this answer? contact us directly to get an explanation for this answer