why my graph not matching this graph?
Afficher commentaires plus anciens
ok so I'm assigned to match this graph. the problem looks straight forwards, but for some reason max and min are not spitting the right values for the highest point and lowest point of a function. why is this? they are spitting out the highest index and lowest index.
f = @(x) x.^3-6.*x;
x = linspace(-3,3,100);
[f0,i0] = min(f(x))
x0 = x(i0)
[f1,i1] = max(g)
x1 = x(i1)
figure
plot(x,f(x),'b-',x0,f0,'rs',x1,f1,'ro')
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
