Probability of an event

1 Ansicht (letzte 30 Tage)
Kendall Donahoe
Kendall Donahoe am 28 Apr. 2020
Bearbeitet: Kendall Donahoe am 28 Apr. 2020
thankyou

Akzeptierte Antwort

David Hill
David Hill am 28 Apr. 2020
You could loop through this many times to attempt to get a better answer.
x=randi(100,100000000,5);
m=[20,63,78,11,45];
s=zeros(100000000,1);
for k=1:5
s=s+double(x(:,k)==m(k));
end
proB=sum(s>=3)/100000000;

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by