Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started