Error for function permutation with repetition.

Dear all,
I am using matlab 2016b and try to find al the permutations with repetition. But it gives me an error saying: Undefined function or variable 'permn'.
So I wonder, what is missing in is my code is there another function/code needed for my version of matlab?
This is the code:
%Find all possible prob
I=0:200;
M = permn(I,3);
Can I have some feedback please?
Thank you in advance

2 Kommentare

madhan ravi
madhan ravi am 10 Feb. 2019
You mean perms() ?
No, I do not think so. It gives me another error: Error using perms
Too many input arguments.
Lets take a small example: I=3:6 and I want to have permutations of 3 with repetition: We should have a list with 4^3 possible outcomes. Some of them are:
3 3 3, 3 3 4, 3 3 5, 3 3 6, 3 4 3, 3 4 4, 3, 4 5, 3 4 6, ......., 6 6 3, 6 6 4, 6 6 5, 6 6 6.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 10 Feb. 2019

2 Stimmen

3 Kommentare

That is exactly the file that helps me to figure out the code. I only get an error when applying the code as I said before. Undefined variable/function
madhan ravi
madhan ravi am 10 Feb. 2019
You have to download it and then use it.
Ok like that!!! Thanks a lot!!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by