can any one help me in detecting an error in matlab code please ?
Show older comments
pih=[];
for im=1:0.1:20
n=15;
i=13;
k=8;
m=2;
h=3;
f=factorial(n)/(factorial(i)*factorial(n-i));
g=factorial((2^(k-(m*h)))*factorial(i)*factorial((2^(k-(m*h)))-i));
p=factorial((2^k))/factorial(i)*factorial((2^k)-i);
j=g/p;
o=factorial((2^k)-(2^(k-(m*h))))/factorial(n-i)*factorial((2^k) ...
-(2^(k-(m*h)))-(n-i));
u=factorial((2^k)-i)/factorial(n-i)*factorial((2^k)-i-(n-i));
z=o/u;
pih=f*j*z;
end
this is the code and this is the error message :
??? Error using ==> factorial at 17
N must be a matrix of non-negative integers.
Error in ==> marwa at 12
g=factorial((2^(k-(m*h)))*factorial(i)*factorial((2^(k-(m*h)))-i));
??? Error using ==> factorial at 17
N must be a matrix of non-negative integers.
Error in ==> marwa at 12
g=factorial((2^(k-(m*h)))*factorial(i)*factorial((2^(k-(m*h)))-i));
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!