Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] How to find probability of die throwing on the spinner by matlab?

Status
Not open for further replies.

Rabia_khan

Newbie level 1
Newbie level 1
Joined
Feb 24, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
here i calculated the probability of a die when thrown on a spinner but the output p(n) which is the total probability of a spinner and die is giving the value "0".
Can anybody help me in this regard.
Thanx


NUM_TRIALS = 500;
trials = 1:NUM_TRIALS;
t = ceil(24*rand(1,NUM_TRIALS));
s = zeros(size(t))

p = zeros(size(t))
for i=trials
for n=1:24
if (t(n)==n)
s(n)=s(n)+1
p(n)=s(n)./trials
else
end

end

end
plot(trials,p(n))
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top