Concept explainers
(a)
A user-defined MATLAB
Answer to Problem 1P
Solution:
The value of
Explanation of Solution
The given function is,
Solve the above equation for
Solve the above equation for
Write the MATLAB code to determine the user-defined MATLAB function for the given math function
MATLAB Code:
Function file
function y = Chapter7_56830_7_1P(x)
y = (0.6.*x.*exp(-0.47.*x))+(1.5.*x.^2.*exp(-0.6.*x));
Script file
x = [-2 4];
y = Chapter7_56830_7_1P(x);
disp('The test values for y(x) are:')
disp(y)
Save the MATLAB script with name, Chapter7_56830_7_1Pa.m in the current folder. Execute the script by typing the script name at the command window to get the code to make a
Result:
Conclusion:
Therefore, the value of
(b)
To make:
A plot of the given function
Answer to Problem 1P
Solution:
The program is stated as follows.
Explanation of Solution
The given function is,
Write the MATLAB code to make a plot of the given function
MATLAB Code:
Function file
function y = Chapter7_56830_7_1P(x)
y = (0.6.*x.*exp(-0.47.*x))+(1.5.*x.^2.*exp(-0.6.*x));
Script file
x = -4:.1:8;
plot(x,Chapter7_56830_7_1P(x));
title('y(x) = (0.6.*x.*exp(-0.47.*x))+(1.5.*x.^2.*exp(-0.6.*x))')
xlabel('x-->')
ylabel('y-->')
Save the MATLAB script with name, Chapter7_56830_7_1Pb.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
Result:
Conclusion:
Therefore, the required program is stated above.
Want to see more full solutions like this?
Chapter 7 Solutions
MATLAB: AN INTRODUCTION WITH APPLICATIO
- MATLAB: An Introduction with ApplicationsStatisticsISBN:9781119256830Author:Amos GilatPublisher:John Wiley & Sons IncProbability and Statistics for Engineering and th...StatisticsISBN:9781305251809Author:Jay L. DevorePublisher:Cengage LearningStatistics for The Behavioral Sciences (MindTap C...StatisticsISBN:9781305504912Author:Frederick J Gravetter, Larry B. WallnauPublisher:Cengage Learning
- Elementary Statistics: Picturing the World (7th E...StatisticsISBN:9780134683416Author:Ron Larson, Betsy FarberPublisher:PEARSONThe Basic Practice of StatisticsStatisticsISBN:9781319042578Author:David S. Moore, William I. Notz, Michael A. FlignerPublisher:W. H. FreemanIntroduction to the Practice of StatisticsStatisticsISBN:9781319013387Author:David S. Moore, George P. McCabe, Bruce A. CraigPublisher:W. H. Freeman