EBK MATLAB: AN INTRODUCTION WITH APPLIC
EBK MATLAB: AN INTRODUCTION WITH APPLIC
5th Edition
ISBN: 8220102007642
Author: GILAT
Publisher: YUZU
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:

EBK MATLAB: AN INTRODUCTION WITH APPLIC, 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:

EBK MATLAB: AN INTRODUCTION WITH APPLIC, 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!
Knowledge Booster
Background pattern image
Electrical Engineering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, electrical-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:PEARSON
Text book image
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:9781337900348
Author:Stephen L. Herman
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Electrical Engineering
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Text book image
Fundamentals of Electric Circuits
Electrical Engineering
ISBN:9780078028229
Author:Charles K Alexander, Matthew Sadiku
Publisher:McGraw-Hill Education
Text book image
Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:9780134746968
Author:James W. Nilsson, Susan Riedel
Publisher:PEARSON
Text book image
Engineering Electromagnetics
Electrical Engineering
ISBN:9780078028151
Author:Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:Mcgraw-hill Education,
Limits and Continuity; Author: The Organic Chemistry Tutor;https://www.youtube.com/watch?v=9brk313DjV8;License: Standard YouTube License, CC-BY