Rank: 3461 based on 9 downloads (last 30 days) and 2 files submitted
photo

Shawn Mikula

E-mail
Company/University
BrainMaps.org

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Shawn View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
21 Aug 2006 enumBase2 Constructs a character or numeric array that enumerates from 0 to (2^n - 1) in binary. Author: Shawn Mikula statistics, probability, combinatorics, permutations, binary, statistics and probab... 1 5
  • 3.0
3.0 | 2 ratings
14 Jun 2006 Screenshot BrainMaps Analyze BrainMaps Analyze is a powerful tool for applying image analysis routines to BrainMaps.org high reso Author: Shawn Mikula medical, brain, image processing, granulometry, neuroscience 8 0
  • 5.0
5.0 | 1 rating
Comments and Ratings on Shawn's Files View all
Updated File Comment by Comments Rating
09 Jan 2008 BrainMaps Analyze BrainMaps Analyze is a powerful tool for applying image analysis routines to BrainMaps.org high reso Author: Shawn Mikula Wang, Bo
21 Aug 2006 enumBase2 Constructs a character or numeric array that enumerates from 0 to (2^n - 1) in binary. Author: Shawn Mikula Lei, John

just what I was looking for

21 Aug 2006 enumBase2 Constructs a character or numeric array that enumerates from 0 to (2^n - 1) in binary. Author: Shawn Mikula Hanselman, Duane

Please don't use user reviews as a way to distribute code. User reviews cannot be deleted, modified or updated. Your code belongs under the Download Now button, not here!

21 Aug 2006 enumBase2 Constructs a character or numeric array that enumerates from 0 to (2^n - 1) in binary. Author: Shawn Mikula Mikula, Shawn

Didn't realize my comment would be posted immediately. Should have said that the updated enumBase2 should appear in 1-2 days. But for those who don't want to wait, here it is:

function [a] = enumBase2(varargin)

% 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.

try
    n = varargin{1}
catch
error('try "help enumBase2"')
end
try
    formout = varargin{2}
catch
formout = 1;
end
if formout==1
a=dec2bin(0:(2^n-1));
elseif formout==2
    aTemp=dec2bin(0:(2^n-1));
    a=ones(2^n-1,n);
    for i=1:n
        for j=1:2^n
            a(j,i)=str2num(aTemp(j,i));
        end
    end
else
    error('try "help enumBase2"')
    
end

21 Aug 2006 enumBase2 Constructs a character or numeric array that enumerates from 0 to (2^n - 1) in binary. Author: Shawn Mikula Mikula, Shawn

thanks John! I have incorporated your suggestion to enhance performance and have added the option to output either a numeric array or a cell array.

Top Tags Applied by Shawn
binary, brain, combinatorics, granulometry, image processing
Files Tagged by Shawn View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
21 Aug 2006 enumBase2 Constructs a character or numeric array that enumerates from 0 to (2^n - 1) in binary. Author: Shawn Mikula statistics, probability, combinatorics, permutations, binary, statistics and probab... 1 5
  • 3.0
3.0 | 2 ratings
14 Jun 2006 Screenshot BrainMaps Analyze BrainMaps Analyze is a powerful tool for applying image analysis routines to BrainMaps.org high reso Author: Shawn Mikula medical, brain, image processing, granulometry, neuroscience 8 0
  • 5.0
5.0 | 1 rating

Contact us at files@mathworks.com