Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HI im trying to run my matlab code but when i hit run it does absolutely nothing can someone help me see whats wrong with

HI im trying to run my matlab code but when i hit run it does absolutely nothing can someone help me see whats wrong with this

Code:

%Question D

function [outcomes] = unfairCoinFlip(p0, flipsCount)

p0 = 1/3;

outcomes = unfairCoinFlip(p0, flipsCount, 'uint8');

for i = 100:flipsCount

x = rand;

if(x < p0)

outcomes(i) = 0; %Head

else

outcomes(i) = 1; %Tail

end

end

end

ok for the person that commented how do i go about fixing it? i thought the function is being called so where did i go wrong. also why would you say the question needs to be updated if you can see the mistakes ive made, that doesnt make any sense.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions