perms
All possible permutations
Syntax
Description
Examples
All Permutations of Double Integers
All Permutations of Unsigned Integers
v = uint16([1023 4095 65535]); P = perms(v)
P = 6x3 uint16 matrix
65535 4095 1023
65535 1023 4095
4095 65535 1023
4095 1023 65535
1023 65535 4095
1023 4095 65535
All Permutations of Complex Numbers
v = [1+1i 2+1i 3+1i]; P = perms(v)
P = 6×3 complex
3.0000 + 1.0000i 2.0000 + 1.0000i 1.0000 + 1.0000i
3.0000 + 1.0000i 1.0000 + 1.0000i 2.0000 + 1.0000i
2.0000 + 1.0000i 3.0000 + 1.0000i 1.0000 + 1.0000i
2.0000 + 1.0000i 1.0000 + 1.0000i 3.0000 + 1.0000i
1.0000 + 1.0000i 3.0000 + 1.0000i 2.0000 + 1.0000i
1.0000 + 1.0000i 2.0000 + 1.0000i 3.0000 + 1.0000i
Input Arguments
v
— Set of items
vector of numeric, logical
, or char
values
Set of items, specified as a vector of numeric, logical
,
or char
values.
Example: [1 2 3 4]
Example: [1+1i
2+1i 3+1i 4+1i]
Example: int16([1
2 3 4])
Example: ['abcd']
Example: [true false true false]
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| char
Complex Number Support: Yes
Limitations
perms(v)
is practical when length(v)
is
less than about 10.
Extended Capabilities
Thread-Based Environment
Run code in the background using MATLAB® backgroundPool
or accelerate code with Parallel Computing Toolbox™ ThreadPool
.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Version History
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)