nextperm
Versione 1.1.0.0 (1,27 KB) da
Steven Gregory
Outputs the next permutation of the ordered tuple x.
Using lexical order on the set {1, 2, ..., N}, outputs the next permutation of the ordered tuple x. You have exhausted the list when All(nextperm(x,N) == x) is TRUE.
For example
nextperm([1 5 4], 5) returns [2 1 3]
nextperm([2 1 3], 5) returns [2 1 4]
nextperm([5 4 3], 5) returns [5 4 3]
Cita come
Steven Gregory (2026). nextperm (https://it.mathworks.com/matlabcentral/fileexchange/22692-nextperm), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Creato con
R2006a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxCategorie
- MATLAB > Mathematics > Linear Algebra >
Scopri di più su Linear Algebra in Help Center e MATLAB Answers
Tag
Riconoscimenti
Ispirato da: modinv(x, N), logmod
Ispirato: Fast batch generation of permutations, logmod, modinv(x, N), egcd.m
Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
