Question: Only16 , please do it by Matlab Scanned by CamScanner Selection Statements 16 Write a function flipvec that will receive one input argunent. If the

 Only16 , please do it by Matlab Scanned by CamScanner SelectionOnly16 , please do it by Matlab

Scanned by CamScanner Selection Statements 16 Write a function flipvec that will receive one input argunent. If the input ment is a row vector, the function will reverse the order and return a vector. If the input argument is a column vector, the function will reverse the order and return a new column vector. If the input argument is a scalar, the function will return the input argument unchanged. In a script, the user is supposed to enter either a y or 'n in prompt. The users input is read into a character variable called letter. The script will print "OK, continuing" if the user enters either a y or Y or it wi print "OK, halting if the user enters a 'n or N or Error" anything else. Put this statement in the script first response to 1 if the user enters letter-input('Enter your anaver '' Write the script using a single nested if-else statement lelseif clause is permittedl. 18. Write the script from the previous exercise using a switch statement instead 19. Inaerodynamic s, the Mach number is a critical quantity. It is defined as the ratio of the speed of an object le.g. an aircraft) to the speed of sound. If the Mach number is less than 1, the flow is subsonic; if the Mach number is equal to 1, the flow is transonic; and if the Mach number is greater than 1, the flowis supersonic. Write a script that will prompt the user for the speed of an aircraft and the speed of sound at the aircraft's current altitude and will print whether the condition is subsonic, transonic, or supersonic. Write a script that will generate one random integer and will print whether the random integer is an even or an odd number. (Hint: an even number is divisible by 2, whereas an odd number is not; so check the remainder after dividing by 2l 20 Global temperature changes have resulted in new patterns of storms in many parts of the world. Tracking wind speeds and a variety of categories of storms is important in understanding the ramifications of these temperature variations Programs that work with storm data will use selection statements to determine the severity of storms and also to make decisions based on the data. 21. Whether a storm is a tropical depression, tropical storm, or hurricane is deter- mined by the average sustained wind speed. In miles per hour, a storm is a trop cal depressionif the winds are less than 38 mph. It is a tropical stormif the winds are between 39 and 73 mph, and it is a hurricane if the wind speeds are> -74 mph. Write a script that will prompt the user for the wind speed of the storm, and will print which type of storm it is 22. 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. The following script first generates a random force value. Then, it prints a message regarding what type of wind that force repre sents, using a switch statement. You are to rewrite this switch statement as one nested if-else statement that accomplishes exactly the same thing. use else and/or elseif clauses. You may

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!