Plotting to test probability convergence
    3 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Petch Anuwutthinawin
 le 3 Juil 2021
  
    
    
    
    
    Réponse apportée : Alan Stevens
      
      
 le 3 Juil 2021
            I have written code that rolls a 12 sided dice and I need to plot a convergence graph for the value being 8 or above. I do not know how to do this.
%% Twelve sided dice
x=linspace(1,100000,100000);
a=1;
b=12;
TS=(a-1)+randi(b-a+1,1,100000);
xbins=[1:12];
hist(TS,xbins);
axis tight;
xlabel('Result of throw');
ylabel('Frequency');
%%this is the part of the code that was written to plot the convergence diagram but I do not know what it plots.
plot(x,TS);
xlabel('Number of trials');
ylabel('Value output');
0 commentaires
Réponse acceptée
  Alan Stevens
      
      
 le 3 Juil 2021
        See my reply to your question at https://uk.mathworks.com/matlabcentral/answers/871048-how-to-do-integration-of-this-equation-and-plot-graph-between-t-and-y?s_tid=srchtitle
That shows you what to do.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Scatter Plots dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

