For creating a cube with plot3d2(.) function it's required to create three matrices for mapping each vertex of the cube.
Think the six faces of the cube, now open them on a plan and hold each vertex position of the cube. Empty elements of the matrix should be filled according spacial logic of the cube, with the same value of the neighbor vertexes.
-->x = [zeros(4, 2), ones(4, 2), zeros(4, 1)]
x =
0. 0. 1. 1. 0.
0. 0. 1. 1. 0.
0. 0. 1. 1. 0.
0. 0. 1. 1. 0.
-->y = ones(4, 5);
-->y(2:3,2:3) = 0
y =
1. 1. 1. 1. 1.
1. 0. 0. 1. 1.
1. 0. 0. 1. 1.
1. 1. 1. 1. 1.
-->z = [zeros(2, 5); ones(2, 5)];
z =
0. 0. 0. 0. 0.
0. 0. 0. 0. 0.
1. 1. 1. 1. 1.
1. 1. 1. 1. 1.
-->plot3d2(x, y, z);
Result is presented in the following image:
In this case, all faces of the cube are equal, which makes this structure symmetric.
Think the six faces of the cube, now open them on a plan and hold each vertex position of the cube. Empty elements of the matrix should be filled according spacial logic of the cube, with the same value of the neighbor vertexes.
-->x = [zeros(4, 2), ones(4, 2), zeros(4, 1)]
x =
0. 0. 1. 1. 0.
0. 0. 1. 1. 0.
0. 0. 1. 1. 0.
0. 0. 1. 1. 0.
-->y = ones(4, 5);
-->y(2:3,2:3) = 0
y =
1. 1. 1. 1. 1.
1. 0. 0. 1. 1.
1. 0. 0. 1. 1.
1. 1. 1. 1. 1.
-->z = [zeros(2, 5); ones(2, 5)];
z =
0. 0. 0. 0. 0.
0. 0. 0. 0. 0.
1. 1. 1. 1. 1.
1. 1. 1. 1. 1.
-->plot3d2(x, y, z);
Result is presented in the following image:
In this case, all faces of the cube are equal, which makes this structure symmetric.