フィルターのクリア

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

3 ビュー (過去 30 日間)
Chirakiat
Chirakiat 2023 年 11 月 17 日
回答済み: Walter Roberson 2023 年 11 月 17 日
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 Center および File ExchangeAssumptions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by