Concept explainers
(a)
A user-defined MATLAB
Answer to Problem 1P
Solution:
The value of
Explanation of Solution
The given function is,
Solve the above equation for
Solve the above equation for
Write the MATLAB code to determine the user-defined MATLAB function for the given math 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
Result:
Conclusion:
Therefore, the value of
(b)
To make:
A plot of the given function
Answer to Problem 1P
Solution:
The program is stated as follows.
Explanation of Solution
The given function is,
Write the MATLAB code to make the plot of the given 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
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
Result:
Conclusion:
Therefore, the program is stated above.
Want to see more full solutions like this?
Chapter 7 Solutions
EBK MATLAB: AN INTRODUCTION WITH APPLIC
- Introductory Circuit Analysis (13th Edition)Electrical EngineeringISBN:9780133923605Author:Robert L. BoylestadPublisher:PEARSONDelmar's Standard Textbook Of ElectricityElectrical EngineeringISBN:9781337900348Author:Stephen L. HermanPublisher:Cengage LearningProgrammable Logic ControllersElectrical EngineeringISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
- Fundamentals of Electric CircuitsElectrical EngineeringISBN:9780078028229Author:Charles K Alexander, Matthew SadikuPublisher:McGraw-Hill EducationElectric Circuits. (11th Edition)Electrical EngineeringISBN:9780134746968Author:James W. Nilsson, Susan RiedelPublisher:PEARSONEngineering ElectromagneticsElectrical EngineeringISBN:9780078028151Author:Hayt, William H. (william Hart), Jr, BUCK, John A.Publisher:Mcgraw-hill Education,