Search All of the Math Forum:

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

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

 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

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.

n=3

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
plot(xyz{:});
elseif n==3
plot3(xyz{:});
end

% Bruno

Date Subject Author
11/23/12 Francisco Seixas
11/23/12 Roger Stafford
11/24/12 Bruno Luong