Write a MATLAB script that will generate a matrix with daily values of time between 0...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a MATLAB script that will generate a matrix with daily values of time between 0 and 240 minutes corresponding to parking times for up to 10 vehicles for 5 days a week and calculates the daily parking amount to pay and the amount to pay for the week. The program will convert the minutes to whole hours and calculate the cost with an hourly parking fee of $1.50. Steps to generate the matrix with values from 0 to 240: a. Prompt the user to input the number of vehicles that used the parking lot. It must be an integer up to 10. If n is not an integer* or within the range, the script must give an error message and prompt the user to input the number of vehicles again. b. Use rand(n,5) to create an nx5 matrix. The function rand(n,m) generates an nxm matrix with elements ranging in value from 0 to 1. c. Multiply the previous matrix by 240 to obtain values from 0 to 240. The script must output the matrices obtained in steps (b) and (c), the matrix containing the corresponding number of hours, the matrix containing the daily parking cost and a summary of the amount paid for the week as follows. The following is an example of the outputs for 3 vehicles: Matrix containing random values from 0 to 1: 0.0540 0.9340 0.4694 0.5308 0.1299 0.0119 0.7792 0.5688 0.3371 0.1622 0.7943 0.3112 0.5285 0.1656 0.6020 Matrix containing parking time in minutes: 12.9480 224.1626 112.6538 127.3914 31.1775 2.8565 187.0001 136.5177 80.9094 Matrix containing parking time in whole hours: 4 1 3 134 212 38.9238 126.8480 190.6283 39.7557 74.6916 144.4757 3 1 2 2 3 142 Matrix containing daily parking fees: Weekly report: 1.5000 4.5000 6.0000 6.0000 1.5000 4.5000 3.0000 1.5000 3.0000 1.5000 6.0000 3.0000 Vehicle 1 pays $16.50 this week Vehicle 2 pays $15.00 this week Vehicle 3 pays $21.00 this week 4.5000 1.5000 4.5000 Write a MATLAB script that will generate a matrix with daily values of time between 0 and 240 minutes corresponding to parking times for up to 10 vehicles for 5 days a week and calculates the daily parking amount to pay and the amount to pay for the week. The program will convert the minutes to whole hours and calculate the cost with an hourly parking fee of $1.50. Steps to generate the matrix with values from 0 to 240: a. Prompt the user to input the number of vehicles that used the parking lot. It must be an integer up to 10. If n is not an integer* or within the range, the script must give an error message and prompt the user to input the number of vehicles again. b. Use rand(n,5) to create an nx5 matrix. The function rand(n,m) generates an nxm matrix with elements ranging in value from 0 to 1. c. Multiply the previous matrix by 240 to obtain values from 0 to 240. The script must output the matrices obtained in steps (b) and (c), the matrix containing the corresponding number of hours, the matrix containing the daily parking cost and a summary of the amount paid for the week as follows. The following is an example of the outputs for 3 vehicles: Matrix containing random values from 0 to 1: 0.0540 0.9340 0.4694 0.5308 0.1299 0.0119 0.7792 0.5688 0.3371 0.1622 0.7943 0.3112 0.5285 0.1656 0.6020 Matrix containing parking time in minutes: 12.9480 224.1626 112.6538 127.3914 31.1775 2.8565 187.0001 136.5177 80.9094 Matrix containing parking time in whole hours: 4 1 3 134 212 38.9238 126.8480 190.6283 39.7557 74.6916 144.4757 3 1 2 2 3 142 Matrix containing daily parking fees: Weekly report: 1.5000 4.5000 6.0000 6.0000 1.5000 4.5000 3.0000 1.5000 3.0000 1.5000 6.0000 3.0000 Vehicle 1 pays $16.50 this week Vehicle 2 pays $15.00 this week Vehicle 3 pays $21.00 this week 4.5000 1.5000 4.5000
Expert Answer:
Related Book For
Posted Date:
Students also viewed these mechanical engineering questions
-
Write a Matlab script that describes the dynamics of Pressure and Flow in the systemic arteries and Left Ventricle. Assume that : 1) Pressure in the Left atrium (PLA) and in the Systemic Veins (Psv)...
-
Write a MATLAB script to plot the efficiency as a function of electric power output for the induction generator of Problem 6.17 as the slip varies from -0.5 to -3.2 percent. Assume the generator to...
-
Write a MATLAB script to produce plots of the speed and efficiency of the single-phase motor of Problem 9.5 as a function of output power over the range 0 < Pout < 500 W.
-
Dozier Industries Inc. manufactures only one product. For the year ended December 31, 2014, the contribution margin increased by $38,500 from the planned level of $1,386,000. The president of Dozier...
-
Explain the difference between cash and accrual accounting.
-
1.1. Give a critical reflection of Disney integration with ESPN and the change in market scenario with the arrival of 3D technology. 1.2. Examine Horizontal and Vertical (Forward) Integration as a...
-
Describe some of the more common criminal offenses that occur in healthcare settings.
-
The College Board provided comparisons of Scholastic Aptitude Test (SAT) scores based on the highest level of education attained by the test takers parents. A research hypothesis was that students...
-
Adams Company makes a product that sells for $ 3 3 per unit. The company pays $ 1 9 per unit for the variable costs of the product and incurs annual fixed costs of $ 1 3 7 , 2 0 0 . Adams expects to...
-
The first-quarter tax return needs to be filed for Prevosti Farms and Sugarhouse by April 15, 2022. For the taxes, assume the second February payroll amounts were duplicated for the March 4 and March...
-
Three partners are dividing a piece of land worth $81,000 among themselves using the lone-divider method. The following table shows the value of the parcels in the eyes of each partner S1 S2 S3 Rita...
-
introduced a model for studying the effects of taxation on investment. The following questions pertain to that model and use the same notation. Suppose that the investor (whose name is Avril) is risk...
-
Oriole Corp. management is planning to spend $650,000 on a new marketing campaign. They believe that this action will result in additional cash flows of $333,000 each year for three years. If the...
-
Iron (Fe) metal is corroded in an aerated dilute acid solution with a pH of 7. Since the corrosion potential (Ekor) of this corrosion cell is -0.45 Volt (SHE) at pH=7, calculate the cathodic current...
-
The Illustration is a schematic depiction of coherent monochromatic light incident upon a thin slit at O that diffracts to thin slits M and N where it emerges to form an Interference pattern on a...
-
Amelia Corporation has the following information about the purchase of a new piece of equipment: Cash revenues less cash expenses $175,000 per year Cost of equipment ...
-
Find the solution to the boundary value problem: The solution is y= d'y 10dy dt +21y = 0, y(0) = 1, y(1)=9
-
Will the prediction interval always be wider than the estimation interval for the same value of the independent variable? Briefly explain.
-
Signal energy and RC circuitThe signal x(t) = e £t £ is defined for all values of t. (a) Plot the signal x(t) and determine if this signal is finite energy. (b) If you determine that x(t)...
-
The sampling signal will be important in the sampling theory later on. (a) As a periodic signal of fundamental period T s express δ Ts (t) by its Fourier series. (b) Determine then the...
-
Starting with the Fourier transform pair and using no integration, indicate the properties of the Fourier transform that will allow you to compute the Fourier transform of the following signals (do...
-
Two samples of ideal gas, sample 1 and sample 2, have the same thermal energy. Sample l has twice as many atoms as sample 2. What can we say about the temperatures of the two samples? A. T>T B. T = T...
-
Christina throws a javelin into the air. As she propels it forward from rest, she does 270 J of work on it. At its highest point, its gravitational potential energy has increased by 70 J. What is the...
-
A runner is moving at a constant speed on level ground. Chemical energy in the runner's body is being transformed into other forms of energy. Most of the chemical energy is transformed into A....
Study smarter with the SolutionInn App