1. Engineering
  2. Computer Science
  3. what more information do you need...

Question: what more information do you need...

Question details

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.

What more information do you need?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution