MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
5th Edition
ISBN: 9781118629864
Author: Amos Gilat
Publisher: WILEY
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 7, Problem 1P
To determine

(a)

A user-defined MATLAB function for the given math function y(x)=(0.2x3+7x2)e0.3x; the value of y(1.5) and y(5) using this function. (Write the function such that x can be a vector.)

Expert Solution
Check Mark

Answer to Problem 1P

Solution:

The value of y(1.5) is 25.7595 and y(5) is 33.4695.

Explanation of Solution

The given function is,

y(x)=(0.2x3+7x2)e0.3x

Solve the above equation for y(1.5).

y(x)=(0.2x3+7x2)e0.3xy(1.5)=(0.2(1.5)3+7(1.5)2)e0.3(1.5)=25.7595

Solve the above equation for y(5).

y(x)=(0.2x3+7x2)e0.3xy(5)=(0.2(5)3+7(5)2)e0.3(5)=33.4695

Write the MATLAB code to determine the user-defined MATLAB function for the given math function y(x)=(0.2x3+7x2)e0.3x and calculate the value of y(1.5) and y(5) using this function.

MATLAB Code:

Function file

function y = Chapter7_29864_7_1P(x)

y = (-0.2*x.^3+7*x.^2).*exp(-0.3*x);

Script file

%...............................Script file.....................

x = [-1.5 5];

y = Chapter7_29864_7_1P(x);

disp('The test values for y(x) are:')

disp(y)

Save the MATLAB script with name, Chapter7_29864_7_1P.m in the current folder. Execute the script by typing the script name at the command window to get the code that determines the user-defined MATLAB function for the given math function y(x)=(0.2x3+7x2)e0.3x and calculate the value of y(1.5) and y(5) using this function.

Result:

MATLAB: An Introduction with Applications, Chapter 7, Problem 1P , additional homework tip  1

Conclusion:

Therefore, the value of y(1.5) is 25.7595 and y(5) is 33.4695.

To determine

(b)

To make:

A plot of the given function y(x) for 2x6.

Expert Solution
Check Mark

Answer to Problem 1P

Solution:

The program is stated as follows.

Explanation of Solution

The given function is,

y(x)=0.6x3e0.47x+1.5x2e0.6x

Write the MATLAB code to make the plot of the given function y(x) for 2x6.

MATLAB Code:

Function file

function y = Chapter7_29864_7_1P(x)

y = (-0.2*x.^3+7*x.^2).*exp(-0.3*x);

Script file

x = -2:0.1:6;

plot(x,Chapter7_29864_7_1P(x));

title('y(x) = (-0.2x^3 + 7x^2)e^{-0.3x}')

xlabel('x')

ylabel('y')

Save the MATLAB script with name, Chapter7_29864_7_1P.m in the current folder. Execute the script by typing the script name at the command window to get the code to make a plot of the given function y(x) for 2x6.

Result:

MATLAB: An Introduction with Applications, Chapter 7, Problem 1P , additional homework tip  2

Conclusion:

Therefore, the program is stated above.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Knowledge Booster
Background pattern image
Statistics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, statistics and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
MATLAB: An Introduction with Applications
Statistics
ISBN:9781119256830
Author:Amos Gilat
Publisher:John Wiley & Sons Inc
Text book image
Probability and Statistics for Engineering and th...
Statistics
ISBN:9781305251809
Author:Jay L. Devore
Publisher:Cengage Learning
Text book image
Statistics for The Behavioral Sciences (MindTap C...
Statistics
ISBN:9781305504912
Author:Frederick J Gravetter, Larry B. Wallnau
Publisher:Cengage Learning
Text book image
Elementary Statistics: Picturing the World (7th E...
Statistics
ISBN:9780134683416
Author:Ron Larson, Betsy Farber
Publisher:PEARSON
Text book image
The Basic Practice of Statistics
Statistics
ISBN:9781319042578
Author:David S. Moore, William I. Notz, Michael A. Fligner
Publisher:W. H. Freeman
Text book image
Introduction to the Practice of Statistics
Statistics
ISBN:9781319013387
Author:David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:W. H. Freeman
Limits and Continuity; Author: The Organic Chemistry Tutor;https://www.youtube.com/watch?v=9brk313DjV8;License: Standard YouTube License, CC-BY