Results 1 to 2 of 2

Math Help - Matlab matrices containing all permutations of a sequence

  1. #1
    Member
    Joined
    Sep 2009
    Posts
    242
    Thanks
    1

    Matlab matrices containing all permutations of a sequence

    Hello,

    Is there some command in MATLAB that will give me an array of all the possible permutations of a given sequence of numbers?

    For example, if I have the sequence 1,2,3, is there a command that will give me the matrix

    1,2,3
    1,3,2
    2,1,3
    2,3,1
    3,1,2
    3,2,1

    Not necessarily in that order, but containing all 3! permutations of 1,2,3.

    Thanks
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

    Re: Matlab matrices containing all permutations of a sequence

    Quote Originally Posted by rainer View Post
    Hello,

    Is there some command in MATLAB that will give me an array of all the possible permutations of a given sequence of numbers?

    For example, if I have the sequence 1,2,3, is there a command that will give me the matrix

    1,2,3
    1,3,2
    2,1,3
    2,3,1
    3,1,2
    3,2,1

    Not necessarily in that order, but containing all 3! permutations of 1,2,3.

    Thanks
    The >>perms<< function will do so.

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. How to program this in matlab or python: matrices
    Posted in the Math Software Forum
    Replies: 0
    Last Post: April 19th 2011, 08:02 AM
  2. Permutations Matrices Question
    Posted in the Advanced Algebra Forum
    Replies: 3
    Last Post: September 24th 2010, 05:08 AM
  3. Matlab help wwith matrices
    Posted in the Math Software Forum
    Replies: 1
    Last Post: July 5th 2010, 10:31 PM
  4. Matrices and permutations
    Posted in the Algebra Forum
    Replies: 5
    Last Post: June 4th 2010, 05:41 AM
  5. Matlab function and matrices help
    Posted in the Math Software Forum
    Replies: 2
    Last Post: May 18th 2010, 01:54 PM

Search Tags


/mathhelpforum @mathhelpforum