perms
所有可能的排列
说明
示例
双精度整数的所有排列
无符号整数的所有排列
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
复数的所有排列
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
输入参数
v
— 项目集合
数值、logical
或 char
值的向量
项目集合,指定为数值、logical
或 char
值的向量。
示例: [1 2 3 4]
示例: [1+1i 2+1i 3+1i 4+1i]
示例: int16([1 2 3 4])
示例: ['abcd']
示例: [true false true false]
数据类型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| char
复数支持: 是
局限性
当 length(v)
大约小于 10 时,perms(v)
较实用。
扩展功能
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
此函数完全支持基于线程的环境。有关详细信息,请参阅在基于线程的环境中运行 MATLAB 函数。
GPU 数组
通过使用 Parallel Computing Toolbox™ 在图形处理单元 (GPU) 上运行来加快代码执行。
此函数完全支持 GPU 数组。有关详细信息,请参阅Run MATLAB Functions on a GPU (Parallel Computing Toolbox)。
版本历史记录
在 R2006a 之前推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 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)