Power set: Difference between revisions

3 bytes removed ,  14 years ago
m
→‎{{header|MATLAB}}: Messed up the powerset preallocation, fixed it.
m (→‎{{header|MATLAB}}: Fixed a typo and changed a variable name so it doesn't conflict with any MATLAB keywords)
m (→‎{{header|MATLAB}}: Messed up the powerset preallocation, fixed it.)
Line 785:
<lang MATLAB>function pset = powerset(theSet)
 
pset = {zeroscell(size(theSet))}; %Preallocate memory
 
%Generate all numbers from 0 to 2^(num elements of the set)-1
Anonymous user