How do I incorporate an interval ?

How do I incorporate into this code that i want to see the local maximum and minimum in this interval x ∈ (-2, 1) ?
syms x
f = 2*x^3 - 3*x^2;
f1 = diff(f);
maxmin = solve(f1)
maxmin = 

 Accepted Answer

Torsten
Torsten on 9 Jan 2024
Edited: Torsten on 9 Jan 2024
Add the line
maxmin = maxmin(maxmin>-2 & maxmin<1)
to your code.

More Answers (0)

Products

Release

R2023b

Tags

Asked:

on 9 Jan 2024

Edited:

on 9 Jan 2024

Community Treasure Hunt

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

Start Hunting!