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

1 vue (au cours des 30 derniers jours)
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.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 27 Juin 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))

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Object Programming dans Help Center et File Exchange

Produits


Version

R14SP1

Community Treasure Hunt

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

Start Hunting!

Translated by