Matrix: how to make Matlab see all possible combinations

4 views (last 30 days)
So the question is, can you have matlab read a matrix so it sees all combinations of numbers in just one variable for example
A=[2,3,5]
I want it to see it as
[2,3,5];[3,5,2];[5,2,3];[2,5,3];[3,2,5];[5,3,2]
So I don't have to retype as I did here, on my script I'm trying to write I'm using a much larger matrix, thank you for your time.

Accepted Answer

Walter Roberson
Walter Roberson on 14 Jan 2016
  1 Comment
Brandon Overman
Brandon Overman on 14 Jan 2016
Thank you very much, I've been looking all over for this even been looking in my book with no such luck. Thank you.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!