Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: 3D points representing cubes to 3D surface?
Replies: 3   Last Post: Nov 29, 2012 5:56 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Adam Aitkenhead

Posts: 51
Registered: 12/9/09
Re: 3D points representing cubes to 3D surface?
Posted: Nov 29, 2012 5:56 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

If A is your Nx3 matrix, then the following code should plot it:

B = zeros(max(A,[],1));
for loopR = 1:size(A,1)
B(A(loopR ,1),A(loopR ,2),A(loopR ,3)) = 1;
end
PATCH_3Darray(B)

This uses the following function from the file exchange:
http://www.mathworks.co.uk/matlabcentral/fileexchange/28497-plot-a-3d-array-using-patch

Hope this helps,
Adam



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.