MATLAB Program:
Can somebody please answer the question for me?
Using MATLAB
A patient is waiting for a suitable matching kidney donor for a transplant. If the probability that a randomly selected donor is a suitable match is p = 0.1, simulate 1000 trials of the number of potential donors until a matching donor is found. Plot a histogram of the obtained sample.
function result = is_match()
x=rand;
if x<=0.1
result = [1];
else
result = [0];
end
end
result = [];
for i=1:100
val = is_match();
result = [val result];
end
h = histogram(result)
MATLAB Program: Can somebody please answer the question for me? Using MATLAB A patient is waiting...