Hello to everyone, i want some help with maltab code. I have to plot some parametric curves to explain them in the master.
I made these functions.
a,b,c is probability colision,
p=[0,1] , is a FACTOR ACB: access class barring
this is users Na=[1,10000] in p0 sector , Nb=[1,6000] in p1 sector , Nc=[1,3000] in p2 sector.
for the users i use the linspace.
i want the code first of alls to calculates a then calculates p0 and then plot PF in parametric curve. i think i lost it somewhere.
So here is what i have done.

 採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 2 月 20 日
編集済み: Sulaymon Eshkabilov 2023 年 2 月 20 日

0 投票

Here is a simple example code to get it done:
N = 1e4;
p = linspace(0,1);
Na = linspace(1, 1e4);
Nb = linspace(1, 6e3);
Nc = linspace(1, 3e3);
p0 = @(Na, N)(Na/N);
p1 = @(Nb, N)Nb/N;
a = @(p, Na)(1-(1-p/12).^Na-1);
p0_v = p0(Na,N);
p1_v = p1(Nb,N);
a_v = a(p,Na);
PF = @(p0,a)(a.*(1-(1-a).*p0).^9);
PF_v= PF(p0_v, a_v);
plot(p0_v,PF_v, 'k-', 'linewidth', 2)
xlabel('$p_0(N_a, \ N)$', 'Interpreter','latex')
ylabel('$PF(p_0, \ a)$', 'Interpreter','latex')
grid on
ylim([-1.1 0.1])

1 件のコメント

Christos Stergiou
Christos Stergiou 2023 年 2 月 23 日
編集済み: Christos Stergiou 2023 年 2 月 23 日
Thank you for your quick answer. I wonder where is the mistake because the probability must be positive, so the y axis must be from 0 until 1.
After 5 mimute i found my mistake, guess i forgot a numeric parenthesis. Everything ok.
Thank you again for your answer, you take me out from a diffucult situation..!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTime Series Events についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by