You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
% Syntax
% "b = allperm(n)" Generates all permutations of Sequence [1:n].
%
% Input :
% n : Greatest Number in Sequence
%
% Output :
% b : output as cell array
%
% Example 1.
% b = allperm(2)
% b =
% {[1 2],[2 1]}
%
% Example 2.
% b = allperm(3)
% b =
% {[1 2 3],[1 3 2],[2 1 3],[2 3 1],[3 1 2],[3 2 1]}
%
% order may be different
%
% Programmed By :
% - Sandeep Solanki
% - rtm_sandeep@rediffmail.com
Cite As
Sandeep Solanki (2026). ALL PERMUTATIONS OF SEQUENCE (https://www.mathworks.com/matlabcentral/fileexchange/37558-all-permutations-of-sequence), MATLAB Central File Exchange. Retrieved .
Acknowledgements
Inspired: uniqueperms
General Information
- Version 1.0.0.0 (1.34 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
