Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions