EBK MATLAB: AN INTRODUCTION WITH APPLIC
EBK MATLAB: AN INTRODUCTION WITH APPLIC
6th Edition
ISBN: 8220103113663
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.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:

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

EBK MATLAB: AN INTRODUCTION WITH APPLIC, 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
Find the value of V0 using the superposition method. Note: The answer is V0=-428.57mv
Don't use ai to answer I will report you answer
If a trolley has a 120VDC power supply intended to power auxiliary components such as lights, buzzers, and speakers, how would the speakers connect to that power system? I understand that speakers typically operate on AC, so what is the most efficient way to connect them to the 120VDC setup? Additionally, could you provide an estimate of the power output for the speakers?

Chapter 7 Solutions

EBK MATLAB: AN INTRODUCTION WITH APPLIC

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
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.
Similar questions
SEE MORE QUESTIONS
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,
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