
To write:
The script for the following switch statement give below first generates a random force value. Then, prints a message regarding what type of wind that force represents, using a switch statement. And rewrite this switch statement as one nested if-else statement that accomplishes exactly the same thing. Use else and/or elseif clauses.
ranforce = randi([0, 12]);
switch ranforce
case 0
disp('There is no wind')
case {1, 2, 3, 4, 5, 6}
disp('There is a breeze')
case {7, 8, 9}
disp('This is a gale')
case {10, 11}
disp('It is a storm')
case 12
disp('Hello, Hurricane!')
end
In which, the Beaufort Wind Scale is used to characterize the strength of winds. The scale uses integer values and goes from a force of 0, which is no wind, up to 12, which is a hurricane.

Want to see the full answer?
Check out a sample textbook solution
Chapter 4 Solutions
Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving
- 1. A consumer group claims that the mean annual consumption of cheddar cheese by a person in the United States is at most 10.3 pounds. A random sample of 100 people in the United States has a mean annual cheddar cheese consumption of 9.9 pounds. Assume the population standard deviation is 2.1 pounds. At a = 0.05, can you reject the claim? (Adapted from U.S. Department of Agriculture) State the hypotheses: Calculate the test statistic: Calculate the P-value: Conclusion (reject or fail to reject Ho): 2. The CEO of a manufacturing facility claims that the mean workday of the company's assembly line employees is less than 8.5 hours. A random sample of 25 of the company's assembly line employees has a mean workday of 8.2 hours. Assume the population standard deviation is 0.5 hour and the population is normally distributed. At a = 0.01, test the CEO's claim. State the hypotheses: Calculate the test statistic: Calculate the P-value: Conclusion (reject or fail to reject Ho): Statisticsarrow_forward21. find the mean. and variance of the following: Ⓒ x(t) = Ut +V, and V indepriv. s.t U.VN NL0, 63). X(t) = t² + Ut +V, U and V incepires have N (0,8) Ut ①xt = e UNN (0162) ~ X+ = UCOSTE, UNNL0, 62) SU, Oct ⑤Xt= 7 where U. Vindp.rus +> ½ have NL, 62). ⑥Xn = ΣY, 41, 42, 43, ... Yn vandom sample K=1 Text with mean zen and variance 6arrow_forwardA psychology researcher conducted a Chi-Square Test of Independence to examine whether there is a relationship between college students’ year in school (Freshman, Sophomore, Junior, Senior) and their preferred coping strategy for academic stress (Problem-Focused, Emotion-Focused, Avoidance). The test yielded the following result: image.png Interpret the results of this analysis. In your response, clearly explain: Whether the result is statistically significant and why. What this means about the relationship between year in school and coping strategy. What the researcher should conclude based on these findings.arrow_forward
- A school counselor is conducting a research study to examine whether there is a relationship between the number of times teenagers report vaping per week and their academic performance, measured by GPA. The counselor collects data from a sample of high school students. Write the null and alternative hypotheses for this study. Clearly state your hypotheses in terms of the correlation between vaping frequency and academic performance. EditViewInsertFormatToolsTable 12pt Paragrapharrow_forwardA smallish urn contains 25 small plastic bunnies – 7 of which are pink and 18 of which are white. 10 bunnies are drawn from the urn at random with replacement, and X is the number of pink bunnies that are drawn. (a) P(X = 5) ≈ (b) P(X<6) ≈ The Whoville small urn contains 100 marbles – 60 blue and 40 orange. The Grinch sneaks in one night and grabs a simple random sample (without replacement) of 15 marbles. (a) The probability that the Grinch gets exactly 6 blue marbles is [ Select ] ["≈ 0.054", "≈ 0.043", "≈ 0.061"] . (b) The probability that the Grinch gets at least 7 blue marbles is [ Select ] ["≈ 0.922", "≈ 0.905", "≈ 0.893"] . (c) The probability that the Grinch gets between 8 and 12 blue marbles (inclusive) is [ Select ] ["≈ 0.801", "≈ 0.760", "≈ 0.786"] . The Whoville small urn contains 100 marbles – 60 blue and 40 orange. The Grinch sneaks in one night and grabs a simple random sample (without replacement) of 15 marbles. (a)…arrow_forwardSuppose an experiment was conducted to compare the mileage(km) per litre obtained by competing brands of petrol I,II,III. Three new Mazda, three new Toyota and three new Nissan cars were available for experimentation. During the experiment the cars would operate under same conditions in order to eliminate the effect of external variables on the distance travelled per litre on the assigned brand of petrol. The data is given as below: Brands of Petrol Mazda Toyota Nissan I 10.6 12.0 11.0 II 9.0 15.0 12.0 III 12.0 17.4 13.0 (a) Test at the 5% level of significance whether there are signi cant differences among the brands of fuels and also among the cars. [10] (b) Compute the standard error for comparing any two fuel brands means. Hence compare, at the 5% level of significance, each of fuel brands II, and III with the standard fuel brand I. [10]arrow_forward
- Analyze the residuals of a linear regression model and select the best response. yes, the residual plot does not show a curve no, the residual plot shows a curve yes, the residual plot shows a curve no, the residual plot does not show a curve I answered, "No, the residual plot shows a curve." (and this was incorrect). I am not sure why I keep getting these wrong when the answer seems obvious. Please help me understand what the yes and no references in the answer.arrow_forwarda. Find the value of A.b. Find pX(x) and py(y).c. Find pX|y(x|y) and py|X(y|x)d. Are x and y independent? Why or why not?arrow_forwardAnalyze the residuals of a linear regression model and select the best response.Criteria is simple evaluation of possible indications of an exponential model vs. linear model) no, the residual plot does not show a curve yes, the residual plot does not show a curve yes, the residual plot shows a curve no, the residual plot shows a curve I selected: yes, the residual plot shows a curve and it is INCORRECT. Can u help me understand why?arrow_forward
- Holt Mcdougal Larson Pre-algebra: Student Edition...AlgebraISBN:9780547587776Author:HOLT MCDOUGALPublisher:HOLT MCDOUGALAlgebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:CengageMathematics For Machine TechnologyAdvanced MathISBN:9781337798310Author:Peterson, John.Publisher:Cengage Learning,
- Algebra: Structure And Method, Book 1AlgebraISBN:9780395977224Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. ColePublisher:McDougal LittellElementary AlgebraAlgebraISBN:9780998625713Author:Lynn Marecek, MaryAnne Anthony-SmithPublisher:OpenStax - Rice University



