plotting max and min of polynomial

15 ビュー (過去 30 日間)
Mohammed Almalki
Mohammed Almalki 2020 年 10 月 18 日
回答済み: Shubham Rawat 2020 年 10 月 27 日
how can I find the maximum and minimum (if any) of the polynomial f(x)= x^3-x^2-3x. plot the function and the max and min (if any) using 'o' for each min and '' for each max?? Thanks in advance!!
  2 件のコメント
Steven Lord
Steven Lord 2020 年 10 月 18 日
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.
Mohammed Almalki
Mohammed Almalki 2020 年 10 月 19 日
I have deficulty in plotting the using 'o' for each min and '' for each max. I did plot the function however, i dont know how to make 'o' for each min and '*' for each max as per the question.

サインインしてコメントする。

回答 (1 件)

Shubham Rawat
Shubham Rawat 2020 年 10 月 27 日
Hello Mohammed Almalki,
As you have mentioned in the comment you may have found extrema points of this function. Now you can Identify the extrema which one is minima and which one is maxima .Then you may use this function to plot Minima marked as 'o' and Maxima marked as '*'.
fplot(f) % where f = x^3-x^2-3x
hold on
plot(extrema(1), subs(f,extrema(1)), 'o') % extrema(1) is minima
plot(extrema(2), subs(f,extrema(2)), '*') % extrema(2) is maxima
hold off
For further reference you may use this document page

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by