MATLAB: A Practical Introduction to Programming and Problem Solving
MATLAB: A Practical Introduction to Programming and Problem Solving
5th Edition
ISBN: 9780128163450
Author: ATTAWAY
Publisher: ELSEVIER
bartleby

Videos

Question
Book Icon
Chapter 4, Problem 23E
To determine

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.

Blurred answer
Students have asked these similar questions
K The mean height of women in a country (ages 20-29) is 63.7 inches. A random sample of 65 women in this age group is selected. What is the probability that the mean height for the sample is greater than 64 inches? Assume σ = 2.68. The probability that the mean height for the sample is greater than 64 inches is (Round to four decimal places as needed.)
In a survey of a group of men, the heights in the 20-29 age group were normally distributed, with a mean of 69.6 inches and a standard deviation of 4.0 inches. A study participant is randomly selected. Complete parts (a) through (d) below. (a) Find the probability that a study participant has a height that is less than 68 inches. The probability that the study participant selected at random is less than 68 inches tall is 0.4. (Round to four decimal places as needed.) 20 2
PEER REPLY 1: Choose a classmate's Main Post and review their decision making process. 1. Choose a risk level for each of the states of nature (assign a probability value to each). 2. Explain why each risk level is chosen. 3. Which alternative do you believe would be the best based on the maximum EMV? 4. Do you feel determining the expected value with perfect information (EVWPI) is worthwhile in this situation? Why or why not?
Knowledge Booster
Background pattern image
Statistics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, statistics and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Holt Mcdougal Larson Pre-algebra: Student Edition...
Algebra
ISBN:9780547587776
Author:HOLT MCDOUGAL
Publisher:HOLT MCDOUGAL
Text book image
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage
Text book image
Mathematics For Machine Technology
Advanced Math
ISBN:9781337798310
Author:Peterson, John.
Publisher:Cengage Learning,
Text book image
Algebra: Structure And Method, Book 1
Algebra
ISBN:9780395977224
Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:McDougal Littell
Text book image
Elementary Algebra
Algebra
ISBN:9780998625713
Author:Lynn Marecek, MaryAnne Anthony-Smith
Publisher:OpenStax - Rice University
Hypothesis Testing using Confidence Interval Approach; Author: BUM2413 Applied Statistics UMP;https://www.youtube.com/watch?v=Hq1l3e9pLyY;License: Standard YouTube License, CC-BY
Hypothesis Testing - Difference of Two Means - Student's -Distribution & Normal Distribution; Author: The Organic Chemistry Tutor;https://www.youtube.com/watch?v=UcZwyzwWU7o;License: Standard Youtube License