Please help me to solve itA=30 30 30 30 30 30 60 60 60 60 60 60 60 60 30 30 30 30 30 30;c,b = hist(A,unique(A));N= length(A);x = permn(b,N);%function permnI have matrix A. I want to sort x. I need c(1,1) no of angle of 30. And c(1,2) no of angle of 60. Means i need 12 nos of 30 and 8 nos of 60 in every permutations.
Up to5%cash back Set Size Permutations 1 1 2 2 3 6 4 24 5 120 6 720 7 5040 8 40320 9 3628868016020882912674368000. #!/usr/bin/perl -w # mjdpermute: permute each word of input use strict. Download the app today and: Get unlimited access to books, videos, and live training.
How can i do it.please help me. Just like perm command works. But it's limited to 10. I need 20.I also have another program but it's only works with 0 and 1.A=1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1;n2 = numel(A);b2 = nnz(A);M2 = 0:ones(1,n2).pow2(n2-1:-1:0)';z2 = rem(floor(M2(:).pow2(1-n2:0)),2);out = z2(sum(z2,2) b2,:). 10 Jan 20196.2.0.0fixed coding style warnings14 May 20166.1.0.0spelling corrections20 May 20156.1.0.0Incorporated the functionality of permnsub, allowing for returning a subset rather than all permutations as well.19 May 20155.1.0.0Renamed file into PERMN, fixed small bug, extended help section9 Apr 20131.3.0.0Reference to COMBNSUB for large combinatorial problems.4 Apr 20111.2.0.0corrected to give column vector output for N=1. (error pointed out by Wilson via email).18 Jan 20101.1.0.0modified slightly based on suggestions by Jan Simon (thanks!)7 May 20081.0.0.0fast algorithm8 May 2007arggg updated with older version.31 Aug 2006new (very fast) algorithm11 May 2006new faster algorithm.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |