필터 지우기
필터 지우기

Error using symengine Unable to prove '2*(c1 + c2 + 1)^(1/2) == 0 & 35 < 5*c1 + 5*c2 + 5' literally.

조회 수: 3 (최근 30일)
I run the code and it returns error "Error using symengine Unable to prove '2*(c1 + c2 + 1)^(1/2) == 0 & 35 < 5*c1 + 5*c2 + 5' literally."
Please help me.
clear all
clc
syms c1 c2
S=50;
r=15;
mu=5;
sigma=2;
L=3;
m=5;
mu_ccLm=(c1+c2+(2*L)-m)*mu
sigma_ccLm=((c1+c2+(2*L)-m)^0.5)*sigma
mm=normcdf(S-r,mu_ccLm,sigma_ccLm)

채택된 답변

Walter Roberson
Walter Roberson 2023년 11월 17일
syms c1 c2
S=50;
r=15;
mu=5;
sigma=2;
L=3;
m=5;
mu_ccLm=(c1+c2+(2*L)-m)*mu
mu_ccLm = 
sigma_ccLm=((c1+c2+(2*L)-m)^0.5)*sigma
sigma_ccLm = 
mm=normcdf(S-r,mu_ccLm,sigma_ccLm)
Conversion to logical from sym is not possible.

Error in normcdf>localnormcdf (line 127)
if sigma > 0

Error in normcdf (line 50)
[varargout{1:max(1,nargout)}] = localnormcdf(uflag,x,varargin{:});
That is the error message I expect for this situation.
There is no special symbolic normcdf() call, so your parameters are being processed by the normal numeric normcdf() call. Several of the statistics-related functions test input parameters numerically in order, such as if they want to have logic similar to
if sigma > 0
do the normal calculation
else
output 0, or nan, or as appropriate
end
There is not much you can do about this, other than to copy the implementing code for normcdf and editing out the numeric tests.

추가 답변 (0개)

카테고리

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