Chapter 5: Problem 1
What is the difference between a script file and a function?
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.
/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none}
Learning Materials
Features
Discover
Chapter 5: Problem 1
What is the difference between a script file and a function?
These are the key concepts you need to understand to accurately answer the question.
All the tools & learning materials you need for study success - in one app.
Get started for free
Probability of Detection \(\left(P_{2}\right)\) versus Probability of False Alarm \(\left(P_{\text {a }}\right)\). The signal strength returned by a radar target usually fluctuates over time. The target will be detected if its signal strength exceeds the detection threshold for any given look. The probability that the target will be detected can be calculated as $$ P_{i=}=\frac{\text { Number of Target Detections }}{\text { Total Number of Looks }} $$ Suppose that a specific radar looks repeatedly in a given direction. On cach look, the range between \(10 \mathrm{~km}\) and \(20 \mathrm{~km}\) is divided into 100 independent range samples (called range gates). One of these range gates contains a target whose amplitude has a normal distribution with a mean amplitude of 7 volts and a standard deviation of I volt. All 100 of the range gates contain system noise with a mean amplitude of 2 volts and a Rayleigh distribution. Determine both the probability of target detection \(P_{d}\) and the probability of a false alarm \(P_{1,}\) on any given look for detection thresholds of \(8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5\), and \(12.0 \mathrm{~dB}\). What threshold would you use for detection in this radar? (Hint: Perform the experiment many times for each threshold and average the results to determine valid probabilities.)
Write a function that uses function randomo to generate a random value in the range [low, high), where low and high are passed as calling arguments. Make random0 a private function called by your new function.
Read Traffic Density. Function random0 produces a number with a uniform probability distribution in the range \([0.0,1.0)\). This function is suitable for simulating random events if each outcome has an equal probability of occurring. However, in many events the probability of occurrence is not equal for every event, and a uniform probability distribution is not suitable for simulating such events. For example, when traffic engineers studied the number of cars passing a given location in a time interval of length \(t\), they discovered that the probability of \(k\) cars passing during the interval is given by the equation $$ P(k, t)=e^{-\lambda t} \frac{(\lambda t)^{4}}{k !} \text { for } t \geq 0, \lambda>0, \text { and } k=0,1,2, \ldots $$ This probability distribution is known as the Poisson distribution: it occurs in many applications in science and engineering. For example, the number of calls \(k\) to a telephone switchboard in time interval \(t\), the number of bacteria \(k\) in a specified volume \(t\) of liquid, and the number of failures \(k\) of a complicated system in time interval \(t\) all have Poisson distributions. Write a function to evaluate the Poisson distribution for any \(k, t\), and A. Test your function by calculating the probability of \(0,1,2, \ldots, 5\) cars passing a particular point on a highway in I minute, given that \(\lambda\) is \(1.6\) per minute for that highway. Plot the Poisson distribution for \(t=1\) and \(\lambda=1.6\).
When a function is called, how is data passed from the caller to the function, and how are the results of the function returned to the caller?
What are the advantages and disadvantages of the pass-by-value scheme used in MATLAB?
What do you think about this solution?
We value your feedback to improve our textbook solutions.