Jump to content

Power set: Difference between revisions

95 bytes removed ,  14 years ago
m
→‎{{header|MATLAB}}: Fixed one more problem that I forgot to delete.
m (→‎{{header|MATLAB}}: Messed up the powerset preallocation, fixed it.)
m (→‎{{header|MATLAB}}: Fixed one more problem that I forgot to delete.)
Line 780:
 
Sets are not an explicit data type in MATLAB, but cell arrays can be used for the same purpose. In fact, cell arrays have the benefit of containing any kind of data structure. So, this powerset function will work on a set of any type of data structure, without the need to overload any operators.
 
Note: Although the keyword "set" is MATLAB function, MATLAB overrides any built-in keywords
 
<lang MATLAB>function pset = powerset(theSet)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.