Help! Program involving 1st and 2nd Derivative

1 view (last 30 days)
This is the Question:
On the interval [0, 2pi], plot the graph of f(x) = sin x + (1/3)sin(3x). In Matlab, find and plot all roots, relative extrema, and inflection points. Plot graphs of f' and f'' on separate axes.
My approach was to graph f, f', and f''. Then i tried to find the zeros of each graph and plot it on its respective curve. However I cannot get all the roots to plot.
Can you help me fix my problem or direct me to another approach that is easier?
Thanks
  3 Comments
Andrew
Andrew on 15 Nov 2013
Oh I see, thank you. But, I am looking for a way to plot the graphs and put a red dot at each of the zeros on the curve.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 15 Nov 2013
Change your
plot(fdprime)
to
plot(x, fdprime)
  6 Comments
Walter Roberson
Walter Roberson on 15 Nov 2013
Consider changing your diff() to gradient()
Andrew
Andrew on 15 Nov 2013
gradient() worked! Thank you very much Mr.Roberson

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!