Cannot use solver function with poisscdf function

조회 수: 11 (최근 30일)
Youssef Badawy
Youssef Badawy 2023년 3월 27일
답변: Torsten 2023년 3월 28일
syms xu
eqn = 0.05 == 1 - poisscdf(35,xu);
S = solve(eqn,xu)
I want to get the mean of the poisson distribution
However, when I run the matlab code above I get the below error
% Error using symengine
% Unable to prove 'xu < 0' literally. Use 'isAlways' to test the statement mathematically.
% Error in sym>logicalNaNIsFalse (line 1965)
% X = mupadmex('symobj::logicalNaNIsFalse',A.s,9);
% Error in sym/any (line 603)
% X = any(logicalNaNIsFalse(A));
% Error in poisscdf (line 45)
% if any(t(:))

답변 (1개)

Torsten
Torsten 2023년 3월 28일
syms lambda n
eqn = exp(-lambda)*symsum(lambda^n/factorial(n),n,0,35) == 0.95;
solve(eqn,lambda)
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
ans = 
26.73116648164810130021030790587

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by