geometric rv code user defined function
Ältere Kommentare anzeigen
I tried to code geometric rv pdf but it's giving accurate result for p=0.5 onlyl
Here, is the code
t=1:10;
p=0.95;
f=geometric_rv(t, p);
z=pdf('geo', t, p);
figure;
plot(f);
hold on;
stem(z);
legend('User-defined', 'system in-built');
hold off;
function f=geometric_rv(t, p)
f=(1-p)*p.^(t);
end
Antworten (1)
t=0:10;
p=0.95;
f=geometric_rv(t, p)
z=pdf('Geo', t, p)
figure;
plot(f);
hold on;
stem(z);
legend('User-defined', 'system in-built');
hold off;
function f=geometric_rv(t, p)
f=p*(1-p).^t;
end
Kategorien
Mehr zu Graph and Network Algorithms finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

