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
You have been hired as an intern to run analyses on the data and report the results back to Sarah; the five questions that Sarah needs you to address are given below.   Does there appear to be a positive or negative relationship between price and screen size? Use a scatter plot to examine the relationship. Determine and interpret the correlation coefficient between the two variables. In your interpretation, discuss the direction of the relationship (positive, negative, or zero relationship). Also discuss the strength of the relationship. Estimate the relationship between screen size and price using a simple linear regression model and interpret the estimated coefficients. (In your interpretation, tell the dollar amount by which price will change for each unit of increase in screen size). Include the manufacturer dummy variable (Samsung=1, 0 otherwise) and estimate the relationship between screen size, price and manufacturer dummy as a multiple linear regression model. Interpret the…
Does there appear to be a positive or negative relationship between price and screen size? Use a scatter plot to examine the relationship. How to take snapshots: if you use a MacBook, press Command+ Shift+4 to take snapshots. If you are using Windows, use the Snipping Tool to take snapshots. Question 1: Determine and interpret the correlation coefficient between the two variables. In your interpretation, discuss the direction of the relationship (positive, negative, or zero relationship). Also discuss the strength of the relationship.  Value of correlation coefficient:   Direction of the relationship (positive, negative, or zero relationship):   Strength of the relationship (strong/moderate/weak): Question 2: Estimate the relationship between screen size and price using a simple linear regression model and interpret the estimated coefficients. In your interpretation, tell the dollar amount by which price will change for each unit of increase in screen size. (The answer for the…
In this problem, we consider a Brownian motion (W+) t≥0. We consider a stock model (St)t>0 given (under the measure P) by d.St 0.03 St dt + 0.2 St dwt, with So 2. We assume that the interest rate is r = 0.06. The purpose of this problem is to price an option on this stock (which we name cubic put). This option is European-type, with maturity 3 months (i.e. T = 0.25 years), and payoff given by F = (8-5)+ (a) Write the Stochastic Differential Equation satisfied by (St) under the risk-neutral measure Q. (You don't need to prove it, simply give the answer.) (b) Give the price of a regular European put on (St) with maturity 3 months and strike K = 2. (c) Let X = S. Find the Stochastic Differential Equation satisfied by the process (Xt) under the measure Q. (d) Find an explicit expression for X₁ = S3 under measure Q. (e) Using the results above, find the price of the cubic put option mentioned above. (f) Is the price in (e) the same as in question (b)? (Explain why.)
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