How to use vector value in equation?

3 ビュー (過去 30 日間)
Dhawal Beohar
Dhawal Beohar 2022 年 8 月 10 日
コメント済み: Dhawal Beohar 2022 年 8 月 17 日
I am trying to use value of g0 from (a) to (b), can anyone please correct me...
d1=20;
n=10^-11.4;
ne=0.5;
m=2.7;
a=0.01:0.01:0.5;
T=1;
PsByN_0dB=5;
PsByN_0=10.^(PsByN_0dB/10);
UmaxdB = 5;
UmaxN_0=10.^(UmaxdB/10);
fun1 = @(u,a) (-1./u).*log(((d1^m)./(a.*ne.*PsByN_0.*T.*u+d1^m).*a)./(1-a));
fun2 = @(u) (1./u).*log(((-exp(u.*UmaxN_0).*(exp(-PsByN_0.*u)))./(u.*UmaxN_0+PsByN_0.*u)).*(PsByN_0.*u)-(PsByN_0.*u.*(exp(-PsByN_0.*u))).*(expint(u.*UmaxN_0+PsByN_0.*u))+(exp(-PsByN_0.*u))+((PsByN_0.*u).*(exp(-PsByN_0.*u))).*(expint(PsByN_0.*u))+(exp(u.*UmaxN_0))./((UmaxN_0/PsByN_0)+1));
fun = @(u,a) (fun1(u,a) - fun2(u));
options = optimset('Display','none');
g0 = arrayfun(@(a)fsolve(@(u)fun(u,a),[0.01],options),a); %a
d0 = @(g0,a) (-1./g0).*log(((d1^m)./(a.*ne.*PsByN_0.*T.*g0+d1^m).*a)./(1-a)); %b

採用された回答

Torsten
Torsten 2022 年 8 月 10 日
You mean
d0 = fun1(g0,a)
?
  19 件のコメント
Torsten
Torsten 2022 年 8 月 17 日
You vary "a" and you vary "PsByN_0dB".
So you get a matrix of dimension
numel(a) x numel(PsByN_0dB)
as result for Pout.
Thus you can plot Pout with respect to the variation of "a" with "PsByN_0dB" fixed
plot(a_array,Pout(:,10).')
or you can plot Pout with respect to the variation of "PsByN_0dB" with "a" fixed
plot(PsByN_0dB_array,Pout(10,:))
(the 10 is of course arbitrary).
Or you can make a surface plot:
[A,PS] = ndgrid(a_array,PsByN_0dB_array)
surf(A,PS,Pout)
Dhawal Beohar
Dhawal Beohar 2022 年 8 月 17 日
Thanks for explaining different graphs. I really appreciate your help.

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by