|
发表于 2004-5-14 19:36:28
|
显示全部楼层
[求助]matlab中,向量怎样作为参数传递
a =
1 2 3
>> factorial(a)
??? Error using ==> factorial
N must be a positive integer.
And we have:
factorial(n) is the product of all the integers from 1 to n, i.e. prod(1:n). Since double pricision numbers only have about 15 digits, the answer is only accurate for n <= 21. For larger n, the answer will have the right magnitute, and is accurate for the first 15 digits.
|
|