Probability of an event
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Kendall Donahoe
 el 28 de Abr. de 2020
  
    
    
    
    
    Editada: Kendall Donahoe
 el 28 de Abr. de 2020
            thankyou
0 comentarios
Respuesta aceptada
  David Hill
      
      
 el 28 de Abr. de 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;
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!