Does the GPLOT function in MATLAB plot nodes in three-dimensions?

1 visualización (últimos 30 días)
The documentation for the GPLOT function specifies that the coordinates can be given as "an n-by-2 or an n-by-3 matrix, where n is the number of nodes and each coordinate pair or triple represents one node." However, if I provide an n-by-3 matrix, GPLOT only plots in two-dimensions.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 27 de Jun. de 2009
This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This has been verified as an error within the documentation for the GPLOT function in MATLAB. Although GPLOT does accept an n-by-3 matrix (as is necessary for the BuckyBall example), it does not utilize this third column.
Currently, to workaround this issue, you can use the following code in place of a call to GPLOT:
[A, xy] = bucky;
[i, j] = find(triu(A));
X = permute(cat(3, xy(i, :),xy(j, :)), [3 1 2]);
plot3(X(:, :, 1), X(:, :, 2), X(:, :, 3))

Más respuestas (0)

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Productos


Versión

R14SP1

Community Treasure Hunt

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

Start Hunting!

Translated by