Question
Exercise 6.2 Write an M-file in which you define the function f (x) sin(x2 )cos x and have Matlab compute the first two derivatives as
Exercise 6.2 Write an M-file in which you define the function f (x) sin(x2 )cos x and
have Matlab compute the first two derivatives as functions df and df2. Using plot, create a graph of the function f and the first two derivatives over the interval [,]. Use different line styles for each plot and a label to distinguish which is which. You may want to truncate the y-axis display to the interval [10,10]. This can be done using the command ylim. Publish your result, after dividing the M-file into appropriate cells so that the output is closely related to the input statements.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started