enumBase2
by Shawn Mikula
19 Aug 2006
(Updated 21 Aug 2006)
Constructs a character or numeric array that enumerates from 0 to (2^n - 1) in binary.
|
Watch this File
|
| File Information |
| Description |
a = enumBase2(n) constructs a cell array that enumerates from 0 to (2^n - 1) in binary.
a = enumBase2(n,outputformat) constructs an array that enumerates from 0
to (2^n - 1) in binary. The type of array output is given by
outputformat. By default, outputformat=1, which outputs a cell array.
If outputformat=2, then the output is a numeric array.
Examples
-------
numBase2(4) returns the following cell array:
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
numBase2(4,2) output the same as above, except as a numeric array.
Useful for combinatorics. |
| MATLAB release |
MATLAB 7.2 (R2006a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (5) |
| 21 Aug 2006 |
John D'Errico
|
|
|
| 21 Aug 2006 |
Shawn Mikula
|
|
|
| 21 Aug 2006 |
Shawn Mikula
|
|
|
| 21 Aug 2006 |
Duane Hanselman
|
|
|
| 21 Aug 2006 |
John Lei
|
|
|
| Updates |
| 21 Aug 2006 |
update to include additional functionality and incorporate user comment to improve performance |
|
Contact us at files@mathworks.com