フィルターのクリア

ERROR: FSOLVE requires all values returned by functions to be of data type double.

2 ビュー (過去 30 日間)
I understand FSOLVE does not work with sym variables but it is not working using fzero as well. OR is there any alternative?
function fval = fun(u)
d1=20;
n=10^-11.4;
m=2.7;
a=0.5;
T=1;
PsByN_0dB=25;
PsByN_0=10.^(PsByN_0dB/10);
fun2 = @(u) ((1./u).*log(expint(2,sym(-PsByN_0.*u))).*exp(-PsByN_0*u));
u0 = -0.0031622776;
U = fsolve(fun2,u0)
I have also tried using fzero:
function fval = fun(u)
d1=20;
n=10^-11.4;
m=2.7;
a=0.5;
T=1;
PsByN_0dB=25;
PsByN_0=10.^(PsByN_0dB/10);
fun2 = @(u) ((1./u).*log(expint(2,sym(-PsByN_0.*u))).*exp(-PsByN_0*u));
u0 = -0.0031622776;
fzero (fun2, u0)
  2 件のコメント
Voss
Voss 2022 年 3 月 19 日
What is the intention here?
expint(2,sym(-PsByN_0.*u))
Dhawal Beohar
Dhawal Beohar 2022 年 3 月 19 日
thats the expression with Two-Argument Exponential Integral and if I not use sym it is giving a error.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2022 年 3 月 19 日
fun2 = @(u) ((1./u).*log(double(expint(2,sym(-PsByN_0.*u)))).*exp(-PsByN_0*u));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOptimization についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by