필터 지우기
필터 지우기

Probability HW Need help

조회 수: 1 (최근 30일)
Khadija Sulail
Khadija Sulail 2021년 1월 26일
답변: David Hill 2021년 1월 26일
Hello,
Can someone help mw with homework? How do I start ? What should I use ? Do I need conditional statements or not ? What kind of variables do I need to do ?
  댓글 수: 1
James Tursa
James Tursa 2021년 1월 26일
Have you written any code yet? Do you have any specific questions about that code? E.g., to simulate a single fair coin flip where 0=tails and 1=heads you could do this:
coinflip = rand < 0.5;

댓글을 달려면 로그인하십시오.

채택된 답변

David Hill
David Hill 2021년 1월 26일
head=1, tails=0. This should give you a good start.
a=randi(2,5,10)-1;
results=sum(a);
b=randi(2,5,1000)-1;
results2=sum(b);
histogram(results2);

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by