The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]
Bruno Luong

Posts: 9,822
Registered: 7/26/08
Re: 3D points representing cubes to 3D surface?
Posted: Nov 24, 2012 4:12 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Here is a function that build edge topology for any dimension. Using this code we can see the number of edge hypercube in a 13th dimensional space is 53248.


c = repmat({[0 1]},[1 n]);
[c{:}] = ndgrid(c{:});
c = cat(n+1,c{:});
c = reshape(c,[],n);
[i, d] = ndgrid((1:2^n)',2.^(0:n-1));
j = (1-c) .* (i+d);
b = j>0;
e = [i(b) j(b)];

xyz = c(e',:);
xyz = reshape(xyz, 2, [], n);
xyz = num2cell(xyz,[1 2]);

if n==2
elseif n==3

% Bruno

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.