i am having prob with this prob code

Question: "How do we find the maxima and minima of a continuous function ff on a closed and bounded interval [a,b]?[a,b]?" • Find the derivative 𝑓′(𝑥) of �
• Find all critical values of 𝑓, let's say 𝑐1, 𝑐2, …, 𝑐𝑘. • Compute 𝑓(𝑎) and 𝑓(𝑏), together with 𝑓(𝑐1),𝑓(𝑐2),…,𝑓(𝑐𝑘). • Compare (order) the values in step 3. • Then the minimum value is global minima of the values in step 4 and the maximum is the global maxima

4 comentarios

Walter Roberson
Walter Roberson el 15 de Mzo. de 2022
Yes, that looks like appropriate methods for finding the minima and maxima. What part are you having difficulty with?
hint: if you are using the symbolic toolbox, see diff()
Muhammad Sheraz Ali
Muhammad Sheraz Ali el 15 de Mzo. de 2022
i am unable to write a correct code for this prob
Walter Roberson
Walter Roberson el 15 de Mzo. de 2022
Please be more specific. Are you having problems with figuring out the name of the sine function in MATLAB? Are you having trouble in expressing ? Are you having trouble with the syntax for writing functions?
Steven Lord
Steven Lord el 15 de Mzo. de 2022
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.

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 15 de Mzo. de 2022

0 votos

You will be able to solve it after you invest 2 hours here:
Hint: gradient() or diff().

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Productos

Versión

R2021b

Preguntada:

el 15 de Mzo. de 2022

Respondida:

el 15 de Mzo. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by