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!
Students have asked these similar questions
Techniques QUAT6221 2025 PT B... TM Tabudi Maphoru Activities Assessments Class Progress lIE Library • Help v The table below shows the prices (R) and quantities (kg) of rice, meat and potatoes items bought during 2013 and 2014:   2013 2014 P1Qo PoQo Q1Po P1Q1   Price Ро Quantity Qo Price P1 Quantity Q1 Rice 7 80 6 70 480 560 490 420 Meat 30 50 35 60 1 750 1 500 1 800 2 100 Potatoes 3 100 3 100 300 300 300 300 TOTAL 40 230 44 230 2 530 2 360 2 590 2 820 Instructions: 1 Corall dawn to tha bottom of thir ceraan urina se se tha haca nariad in archerca antarand cubmit Q Search ENG US 口X 2025/05
The table below indicates the number of years of experience of a sample of employees who work on a particular production line and the corresponding number of units of a good that each employee produced last month. Years of Experience (x) Number of Goods (y) 11 63 5 57 1 48 4 54   45 3 51 Q.1.1 By completing the table below and then applying the relevant formulae, determine the line of best fit for this bivariate data set.  Do NOT change the units for the variables.   X y X2 xy         Ex= Ey= EX2 EXY= Q.1.2 Estimate the number of units of the good that would have been produced last month by an employee with 8 years of experience.   Q.1.3 Using your calculator, determine the coefficient of correlation for the data set. Interpret your answer. Q.1.4 Compute the coefficient of determination for the data set. Interpret your answer.
Q.3.2 A sample of consumers was asked to name their favourite fruit. The results regarding the popularity of the different fruits are given in the following table. Type of Fruit Number of Consumers Banana 25 Apple 20 Orange 5 TOTAL 50 Draw a bar chart to graphically illustrate the results given in the table.
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.
Similar questions
SEE MORE QUESTIONS
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