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

3 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 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))

More Answers (0)

Categories

Find more on Graphics Object Programming in Help Center and File Exchange

Products


Release

R14SP1

Community Treasure Hunt

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

Start Hunting!