Matlab
Matlab
6th Edition
ISBN: 9781119299257
Author: Amos Gilat
Publisher: WILEY CONS
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, 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, 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
WHAT IS THE CORRECT ANSWER AND WHY?
A common way for two people to settle a frivolous dispute is to play a game of rock-paper-scissors. In this game, each person simultaneously displays a hand signal to indicate a rock, a piece of paper, or a pair of scissors. Rock beats scissors, scissors beats paper, and paper beats rock. If both players select the same hand signal, the game results in a tie. Two roommates, roommate A and roommate B, are expecting company and are arguing over who should have to wash the dishes before the company arrives. Roommate A suggests a game of rock-paper-scissors to settle the dispute.      Consider the game of rock-paper-scissors to be an experiment. In the long run, roommate A chooses rock 21% of the time, and roommate B chooses rock 61% of the time; roommate A selects paper 39% of the time, and roommate B selects paper 21% of the time; roommate A chooses scissors 40% of the time, and roommate B chooses scissors 18% of the time. (These choices are made randomly and independently of each…
A qualifying exam for a graduate school program has a math section and a verbal section. Students receive a score of 1, 2, or 3 on each section. Define X as a student’s score on the math section and Y as a student’s score on the verbal section. Test scores vary according to the following bivariate probability distribution.       y       1 2 3   1 0.22 0.33 0.05 x 2 0.00 0.08 0.20   3 0.07 0.05 0.00   μXX =    , and μYY =       σXX =    , and σYY =       The covariance of X and Y is    . The coefficient of correlation is    . The variables X and Y    independent.   The expected value of X + Y is    , and the variance of X + Y is    .   To be accepted to a particular graduate school program, a student must have a combined score of 4 on the qualifying exam. What is the probability that a randomly selected exam taker qualifies for the program? 0.45   0.47   0.46   0.33     Chebysheff’s Theorem states that the…

Chapter 7 Solutions

Matlab

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