MATLAB: What is the MATLAB function to evaluate ncr value when n is real ncr value what is the MATLAB function to evaluate ncr value when n is real Best Answer If n and r are both non-negative integers, and n >= r, use:nCr = nchoosek(n,r)If n and/or r can be negative, you can use the more general form:nCr = gamma(n+1)/(gamma(r+1)*gamma((n-r)+1))If either n or r is an integer <= -1, then the nCr is not defined. Related SolutionsMATLAB: Accumulating Unique Set Values My suggestion: first find the unique rows of Fset, and then get the column indices for each rowFSet = randi(2,10,3) -1 % exampleUFS = unique(FSet,'rows','stable')UnqFS = arrayfun(@(r) find(UFS(r,:)), 1:size(UFS,1), 'un',0)celldisp(UnqFS) MATLAB: How to create a series of permutation matrices a = dec2bin(0:511,9) - '0';n = sum(a,2);out = reshape(a(n <= 6 & n >= 1,:).',3,3,[]);ADDa = dec2bin(0:511,9) - '0';n = sum(a,2);out = reshape(a(n <= 6 & n >= 1 & all(a(:,[1:4:9])==0,2),:).',3,3,[]); Related QuestionHow to find the sum terms in of binomial expansionHow to display the terms of a binomial expansion (x+y)^n
Best Answer