Question: Matlab Languge please Erercise 6: Decision making Write your own script files to solve the following problems: 1. Write a script file that asks the

 Matlab Languge please Erercise 6: Decision making Write your own scriptfiles to solve the following problems: 1. Write a script file that

Matlab Languge please

Erercise 6: Decision making Write your own script files to solve the following problems: 1. Write a script file that asks the user for the input of a number and returns the natural logarithm of the number if the number is positive, and displays an error message otherwise. 2. The cost per kilometre for a rental car is 0.50 for the first 100 kilometres, 0.30 for the next 200 kilometres and 0.20 for all kilometres in excess of 300 kilometres. Write a function that determines the total cost for a given number of kilometres. 3. Write a function to evaluate f(r, y) for any two user specified values r and y. The function f(z, y) is defined as: 2y and y2 4. The energy loss due to fluid flow through a pipe can be calculated using the following equations DV where: RE = energy loss per mass of fluid flowing (J/kg) f = friction factor (dimensionless) L = pipe length (m) D = pipe diameter (m) V average fluid velocity (m/s) Q = volumetric flow rate (m/s) A = pipe cross-sectional area (m2) Re- Reynolds number (dimensionless) = fluid density (kg/m3) fluid viscosity (kg/ms)

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!