|
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <h2an11$k7n$1@fred.mathworks.com>...
> "Husam Aldahiyat" <numandina@gmail.com> wrote in message <h2alri$2o3$1@fred.mathworks.com>...
> > Hello,
> > Just like we do with nchoosek, I want a way to obtain the number of rows of the output of perms, without obtaining what they are.
> >
> > Please help!
> >
> > Specifically, I want the following:
> >
> > length(unique(perms([ones(1,20),zeros(1,20)])))
>
> % I guess you miss 'rows'
> m = 2;
> n = 6;
> p=unique(perms([ones(1,m),zeros(1,n)]),'rows');
>
> size(p,1) == nchoosek(m+n,n)
>
> % Bruno
Actually I used rows in my code I just forgot to put it in the message.
About your code, I don't understand the final line. I have a headache please bear with me! And I want m and n to be 20 and 20. That's why I'm looking for a getaround, because the matrix for perms would be very big to do it normally :(
|