Question

MATLAB Program: Can somebody please answer the question for me? Using MATLAB A patient is waiting...

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1


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)

Add a comment
Know the answer?
Add Answer to:
MATLAB Program: Can somebody please answer the question for me? Using MATLAB A patient is waiting...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT