Code covered by the BSD License  

Highlights from
Combin2Rank

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 1.77 KB File ID: #22717

Combin2Rank

by Paulo Fonte

 

18 Jan 2009 (Updated 19 Jan 2009)

Calculates the rank (sequential ordinal) of nCk combinations

| Watch this File

File Information
Description

Example:

Combs=nchoosek(1:5,3)
Combs =
     1 2 3
     1 2 4
     1 2 5
     1 3 4
     1 3 5
     1 4 5
     2 3 4
     2 3 5
     2 4 5
     3 4 5
Combin2Rank(5,3,Combs)
ans =
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10

ref: A Numbering System for Combinations, Gary D. Knott, Communications of the ACM, Jan. 1974, v.17, n.1

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
19 Jan 2009

Small programming tweaks.

Tag Activity for this File
Tag Applied By Date/Time
mathematics Paulo Fonte 19 Jan 2009 10:38:36

Contact us at files@mathworks.com