find the minimum value of y for positive vales of x

3 次查看(过去 30 天)
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 ?

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by