I have a vector A=[1 1 1 0 0 1 1]. I want all the possible combinations as following….

A=[1 1 1 0 0 0 0; 1 1 0 0 0 1 0; 1 1 0 0 0 0 1; 0 1 1 0 0 1 0; 0 1 1 0 0 0 1; 0 1 0 0 0 1 1]

Skip to content# MATLAB: How to obtain all possible combinations of a given vector

###### Related Question

binomial coefficientmatrixpermutation

I have a vector A=[1 1 1 0 0 1 1]. I want all the possible combinations as following….

A=[1 1 1 0 0 0 0; 1 1 0 0 0 1 0; 1 1 0 0 0 0 1; 0 1 1 0 0 1 0; 0 1 1 0 0 0 1; 0 1 0 0 0 1 1]

- How to place a cell array in another cell array using ‘find’
- How to find which rows are identical in a matrix
- Change binary string to decimal
- Generating sequence of given numbers
- Warning: Unsuccessful read: The specified amount of data was not returned within the Timeout period.
- How to group elements of a logical array
- Sort in ascending order for first column then descending order for the second column.

## Best Answer