find the minimum value of y for positive vales of x

9 vues (au cours des 30 derniers jours)
Aaron Aguilar
Aaron Aguilar le 3 Sep 2020
Commenté : per isakson le 3 Sep 2020
i have xmin=min(y(x>0)); where x=[-100:100] & y =x^3+60x^2-50 it gives me -50 which is wrong
aloso i have xmin=min(y(0:x(end))); where x=[-100:100] & y =x^3+60x^2-50 it gives me -50 which is wrong answer
any ideas? is my expression wrong ?
  1 commentaire
per isakson
per isakson le 3 Sep 2020
I fail to run the code snippets of your question

Connectez-vous pour commenter.

Réponse acceptée

per isakson
per isakson le 3 Sep 2020
Try this
%%
x = (-100:100);
y = x.^3+60*(x.^2)-50;
%%
xmin = min(y(x>0))
which returns
xmin =
11
>>

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by