
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:n1)); j = (1c) .* (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

