Ideal Soliton Distribution code

3 ビュー (過去 30 日間)
Ronald Niwamanya
Ronald Niwamanya 2020 年 11 月 11 日
回答済み: Star Strider 2020 年 11 月 11 日
The Ideal Soliton distribution is given by the following:
P(d) =1/K for d=1
=1/(d(d-1) ) for d=2,3,4……K.
Forexample when K=20, P(1)=1/20, P(2)=0.5 and so on
How can I write a Matlab Code and be able to
Plot P(d) Vs d for K of say 20.
Thank you

採用された回答

Star Strider
Star Strider 2020 年 11 月 11 日
I never heard of this distribution before, so I have no idea what its properties should be.
See if this does what you want:
d = 1:20;
P = @(d) (1./(d.*(max(d,2)-1))).*(d>1) + (1./max(d)).*(d==1);
figure
plot(d, P(d))
grid
.

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by