Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

# $ Textbook Solutions Expert Q&A Study Pack Practice Learn NEW!

Sign in More "

Find solutions for your homework Search

home / study / engineering / electrical engineering / control theory / control theory solutions manuals / matlab / 4th edition / chapter 7

We have solutions for your book!


Problem 1P: Chapter: CH7 Problem: 1P

The fuel efficiency of an automobile is measured in mi/gal (miles per U.S. gallon) or in km/L (kilometers per liter). Write a
MATLAB user-defined function that converts fuel efficiency values from km/L to mi/gal. For the function name and
arguments use mpg=kml TOmpg(kml). The input argument kml is the efficiency in km/L, and the output argument mpg is
the efficiency in mi/gal. Use the function in the Command Window to:

(a) Determine the fuel efficiency in mi/gal of a car that consumes 9 km/L.

(b) Determine the fuel efficiency in mi/gal of a car that consumes 14 km/L.

MATLAB
(4th Edition) Edit edition
Step-by-step solution:
71%(14 ratings)
for this chapter’s solutions

Solutions for Chapter 7 Step 1 of 4


The fuel efficiency of an The function name and argument used is,
automobile is measured in
mi/gal (mi…

Get solutions The input argument is is the efficiency in

The output argument is the efficiency in


Looking for the textbook?

Step 2 of 4

The following is the MATLAB user-defined function that converts fuel efficiency values from km/L to mi/gal:

%This user defined function is used to convert fuel efficiency values from km/L to ml/gal

%1 kilometer / l = 2.35214583 mi / US gallon

function mpg=kmlTOmpg(kml)

mpg=kml*2.35214583;

Save this function as kmlTOmpg.m in the current folder

Step 3 of 4

The car consumes .

Run the MATLAB user-defined function kmlTOmpg.m by typing the following command in the MATLAB command
window:

>> mpg=kmlTOmpg(9)

The following is the MATLAB output:

mpg =

21.1693

Thus, the fuel efficiency of a car that consumes is .

Step 4 of 4

(b)

The car consumes .

Run the MATLAB user-defined function kmlTOmpg.m by typing the following command in the MATLAB command
window:

>> mpg=kmlTOmpg(14)

The following is the MATLAB output:

mpg =

32.9300

Thus, the fuel efficiency of a car that consumes is .

Back to top

Corresponding Textbook

MATLAB | 4th Edition


ISBN-13: 9781118136621 This is an alternate ISBN. View the
ISBN: 1118136624 primary ISBN for: MATLAB 4th Edition
Textbook Solutions
Authors: Amos Gilat

Rent | Buy

Solutions for Problems in Chapter 7

1P 2P 3P 4P 5P

6P 7P 8P 9P 10P

11P 12P 13P 14P 15P

16P 17P 18P 19P 20P

21P 22P 23P 24P 25P

26P 27P 28P 29P 30P

31P 32P 33P 34P 35P

36P 37P 38P 39P

Back to top

Get more help from Chegg

Get 1:1 help now from expert


!
"

Electrical Engineering tutors

ABOUT CHEGG LEGAL & POLICIES CHEGG PRODUCTS AND SERVICES CHEGG NETWORK CUSTOMER SERVICE

Become a Tutor Advertising Choices Cheap Textbooks Online Tutoring EasyBib Customer Service
Chegg For Good Cookie Notice Chegg Coupon Sell Textbooks Internships.com Give Us Feedback
College Marketing General Policies Chegg Play Solutions Manual Studyblue Help with Chegg Tutors
Corporate Development Intellectual Property Rights Chegg Study Help Study 101 Thinkful Help with eTextbooks
Investor Relations Terms of Use College Textbooks Test Prep Help to use EasyBib Plus
Jobs Chegg Tutors Terms of Service eTextbooks Textbook Rental Manage Chegg Study
Join Our Affiliate Program Global Privacy Policy Chegg Math Solver Used Textbooks Subscription

Media Center DO NOT SELL MY INFO Mobile Apps Digital Access Codes Return Your Books

Site Map Honor Code Textbook Return Policy

© 2003-2020 Chegg Inc. All rights reserved.

You might also like