Write a function m-file that accepts one input. The function file should have no outputs and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a function m-file that accepts one input. The function file should have no outputs and should display the following when it is run: 1. If the input is greater than 0, it should count backwards in increments of 5 and stop before crossing 0 (all of the numbers should be displayed). 2. If the input is less than 0, it should count forward in increments of 4 and stop before crossing 0 (again, all of the numbers should be displayed). 3. If the input value is 0, your function should display a joke. Assume that this function will only be used with integer inputs. Write a function m-file that accepts one input. The function file should have no outputs and should display the following when it is run: 1. If the input is greater than 0, it should count backwards in increments of 5 and stop before crossing 0 (all of the numbers should be displayed). 2. If the input is less than 0, it should count forward in increments of 4 and stop before crossing 0 (again, all of the numbers should be displayed). 3. If the input value is 0, your function should display a joke. Assume that this function will only be used with integer inputs.
Expert Answer:
Answer rating: 100% (QA)
Answer MATLAB code function countdownOrCountupinputvalue if inputvalue 0 ... View the full answer
Posted Date:
Students also viewed these chemistry questions
-
Write each of these angles in degrees correct to 1 decimal place. a. 1.3 rad b. 2.5 rad c. 1.02 rad d. 1.83 rad e. 0.58 rad
-
An organic compound with the molecular formula C4H10O3 shows properties of both an alcohol and an ether. When treated with an excess of hydrogen bromide, it yields only one organic compound, 1,...
-
In Figure particles 1 and 2 are fixed in place on an x axis, at a separation of L = 8.00cm. Their charges are q1 = + e and q2 = ?? 27e.Particle 3 with charge q3 = + 4e is to be placed on the line...
-
In Problems 6374, perform the indicated operations and simplify the result. Leave your answer in factored form. 3x x - 1 x - 4 18 x - 2x + 1 2
-
Computed tomography (CT) scans are used to diagnose the need for the removal of the appendix. CT scans give the patient a large level of radiation, which has risks, especially for young people. There...
-
A certain type of mint has a label weight of 20.4 grams. Suppose that the probability is 0.90 that a mint weighs more than 20.7 grams. Let X equal the number of mints that weigh more than 20.7 grams...
-
Below is a frequency distribution table for a hypothetical variable: a. How many of the scores for this variable have the value 70 ? b. What percentage of the scores has the value of 30 ? Value f%...
-
The following are several accounts of the Graf Corporation at the end of 2007: Account Credit Balance Common stock , $10 par ............ $ 47,100 Bonds payable (due 2014) ........... 126,000 Premium...
-
The Expectancy theory concept of "expectancy" refers to what explain?
-
Show that the probability that the period of f(x)=a x mod M is odd is at most 1/2.
-
You are returning a client's phone call and cannot reach them. What are some tips to consider? Answer the following questions: How long should the message be max? What information should you include?...
-
Polaris Industries wishes to purchase a multiple-use in-plant road test simulator that can be used for ATVs, motorcycles, and snowmobiles. This is for research and experimentation and is considered...
-
A portable generator is needed at a remote construction site. Two alternatives are being considered. Their annual fixed costs and operating and maintenance costs per hour are shown in the table...
-
The Fence Company is setting up a new production line to create top rails. The relevant data for two alternatives are shown below. a. Based on MARR of 8 percent, determine the annual rate of...
-
Cowboy Metal Cutting produces a laser-cut part based on customer orders. The number of units requested on a customers order for the laser-cut part can vary from 1 to 150. Cowboy has determined that...
-
A utility is submitting their petition to their regulatory agency to justify rates for the upcoming year. Their proposal is based upon revenue requirements. The company has 45 percent of their...
-
Introduction to Accounting An Integrated Approach EighthEdition Chapter 5 P5.10 P5.10 Engelhaupt Company is considering a switch to JIT. It has gathered the following data: In addition, Engelhaupt...
-
On October 1, 2021, Adoll Company acquired 2,600 shares of its $1 par value stock for $38 per share and held these shares in treasury. On March 1, 2023, Adoll resold all the treasury shares for $34...
-
Reconsider the data of Problem 31. Data from Problem 31 The following three investment opportunities are available. The returns for each investment for each year vary, but the first cost of each is...
-
The following three investment opportunities are available. The returns for each investment for each year vary, but the first cost of each is $20,000. Based on a future worth analysis, which...
-
Explain the concept of a control variable and the assumption necessary for a control variable to be effective.
Study smarter with the SolutionInn App