Question: What more information do you need? Write a MATLAB function missile.m to simulate a single instance of target practice on the derelict ship. Your function

 What more information do you need? Write a MATLAB function missile.m

What more information do you need?

Write a MATLAB function missile.m to simulate a single instance of target practice on the derelict ship. Your function should accept 6 parameters: the probability of successful strikes for missiles A, B and C and the probabilities of the ship being destroyed if hit by 1, 2 or all 3 missiles. Your function should return at least 4 parameters: a series of flags (1 or 0) to indicate if missile A, B or C hit and a flag to indicate if the ship was sunk or not. Your function should use the MATLAB rand utility along with the input probabilities to assign the state of the output variables. Recall that each missile is independent of each other missile implying you should use multiple calls to rand to determine the action of the missile. Another call to rand should be used to determine if the ship was destroyed based on the number of missiles that hit the target

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!