MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
6th Edition
ISBN: 9781119256830
Author: Amos Gilat
Publisher: John Wiley & Sons Inc
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.6x3e0.47x+1.5x2e0.6x; the value of y(2) and y(4) 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(2) is 16.8487 and y(4) is 2.5434.

Explanation of Solution

The given function is,

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

Solve the above equation for y(2).

    y(x)=0.6x3e0.47x+1.5x2e0.6xy(2)=0.6(2)3e0.47( 2)+1.5(2)2e0.6( 2)=16.8487

Solve the above equation for y(4).

    y(x)=0.6x3e0.47x+1.5x2e0.6xy(4)=0.6(4)3e0.47(4)+1.5(4)2e0.6(4)=2.5434

Write the MATLAB code to determine the user-defined MATLAB function for the given math function y(x)=0.6x3e0.47x+1.5x2e0.6x and calculate the value of y(2) and y(4) using this 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 3-D plot (shown in the figure) that shows the trajectory of the ball during the first five bounces in which the position of ball is given as a function of time and the velocities is given in the x and y direction.

Result:

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

Conclusion:

Therefore, the value of y(2) is 16.8487 and y(4) is 2.5434.

To determine

(b)

To make:

A plot of the given function y(x) for 4x8.

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 a plot of the given function y(x) for 4x8.

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 y(x) for 4x8.

Result:

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

Conclusion:

Therefore, the required 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
Question 2: When John started his first job, his first end-of-year salary was $82,500. In the following years, he received salary raises as shown in the following table. Fill the Table: Fill the following table showing his end-of-year salary for each year. I have already provided the end-of-year salaries for the first three years. Calculate the end-of-year salaries for the remaining years using Excel. (If you Excel answer for the top 3 cells is not the same as the one in the following table, your formula / approach is incorrect) (2 points) Geometric Mean of Salary Raises: Calculate the geometric mean of the salary raises using the percentage figures provided in the second column named “% Raise”. (The geometric mean for this calculation should be nearly identical to the arithmetic mean. If your answer deviates significantly from the mean, it's likely incorrect. 2 points) Hint for the first part of question 2: To assist you with filling out the table in the first part of the question,…
Consider a sample with data values of 27, 25, 20, 15, 30, 34, 28, and 25. Compute the range, interquartile range, variance, and standard deviation (to a maximum of 2 decimals, if decimals are necessary). Range   Interquartile range   Variance   Standard deviation
Perform a Step by step  following tests in Microsoft Excel. Each of the following is 0.5 points, with a total of 6 points. Provide your answers in the following table. Median Standard Deviation Minimum Maximum Range 1st Quartile 2nd Quartile 3rd Quartile Skewness; provide a one sentence explanation of what does the skewness value indicates Kurtosis; provide a one sentence explanation of what does the kurtosis value indicates Make a labelled histogram; no point awarded if it is not labelled Make a labelled boxplot; no point awarded if it is not labelled   Data 27 30 22 25 24 22 20 28 20 26 21 23 24 20 28 30 20 28 29 30 21 26 29 25 26 25 20 30 26 28 25 21 22 27 27 24 26 22 29 28 30 22 22 22 30 21 21 30 26 20

Chapter 7 Solutions

MATLAB: An Introduction with Applications

Ch. 7 - Write a user-defined function that calculates...Ch. 7 - Write a user-defined MATLAB function that...Ch. 7 - Write a user-defined MATLAB function that...Ch. 7 - Write a user-defined MATLAB function that...Ch. 7 - Prob. 15PCh. 7 - The area of a triangle ABC can be calculated by:...Ch. 7 - As shown in the figure, the area of a convex...Ch. 7 - Write a user-defined function that determines the...Ch. 7 - Write a user-defined MATLAB function that converts...Ch. 7 - Write a user-defined function that plots a...Ch. 7 - Write a user-defined function that plots an...Ch. 7 - Prob. 22PCh. 7 - Write a user-defined function that determines if a...Ch. 7 - The harmonic mean H of a set of n positive numbers...Ch. 7 - Write a user-defined function that determines the...Ch. 7 - Write a user-defined function that determines the...Ch. 7 - Write a user-defined function that sorts the...Ch. 7 - Write a user-defined function that sorts the...Ch. 7 - Write a user-defined MATLAB function that finds...Ch. 7 - Write a user-defined MATLAB function that...Ch. 7 - The shortest distance between two points on the...Ch. 7 - Delta rosette is a set of three strain gages...Ch. 7 - In a lottery the player has to select several...Ch. 7 - 34. The Taylor series expansion for sin x about x...Ch. 7 - Write a user-defined function that determines the...Ch. 7 - The area moment of inertia Ixe of a rectangle...Ch. 7 - The simple RC high-pass filter shown in the figure...Ch. 7 - A circuit that filters out a certain frequency is...Ch. 7 - The first derivative df(x)dx a function f(x) at a...Ch. 7 - In lottery the player has to guess correctly r...
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
Points, Lines, Planes, Segments, & Rays - Collinear vs Coplanar Points - Geometry; Author: The Organic Chemistry Tutor;https://www.youtube.com/watch?v=dDWjhRfBsKM;License: Standard YouTube License, CC-BY
Naming Points, Lines, and Planes; Author: Florida PASS Program;https://www.youtube.com/watch?v=F-LxiLSSaLg;License: Standard YouTube License, CC-BY