Filter löschen
Filter löschen

how can i plot the pdf of a bernoulli using matlab

2 Ansichten (letzte 30 Tage)
oshomah kanoba
oshomah kanoba am 1 Mär. 2015
Kommentiert: Image Analyst am 1 Mär. 2015
which algorithm can i use in plotting the cdf of a bernoulli using matlab

Antworten (1)

Star Strider
Star Strider am 1 Mär. 2015
Bearbeitet: Star Strider am 1 Mär. 2015
The closest you can get is the binomial distrbution, specifically the binopdf function (in the Statistics Toolbox).
— EDIT —
Your Subject says ‘pdf’ and your Question says ‘cdf’. This uses ‘cdf’.
Experiment with this to get the result you want:
% Bernoulli CDF Plot
p = 0.5; % Probability Of Success
N = 10; % Maximum Number OF Trials
Nv = [1:N];
C = binocdf(1, Nv, 0.5);
figure(1)
plot(Nv, C)
grid
  1 Kommentar
Image Analyst
Image Analyst am 1 Mär. 2015
I'm not sure if the question is about how to plot, or how to get the cdf/pdf, or both. Other plotting options include bar() and area().

Melden Sie sich an, um zu kommentieren.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by