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!

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.
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