f(x)=x^2+2x-3
x belong to [0,20]
i- How can I optimize the function in matlab?

3 件のコメント

Stephen23
Stephen23 2018 年 5 月 14 日
編集済み: Stephen23 2018 年 5 月 14 日
@Noor Bano: what does "optimize the function" mean? What is the output that you want from this?
Ammy
Ammy 2018 年 5 月 14 日
How to maximize a function, or how to minimize a function, or in other words on which x value the function gives maximum or minimum value.
Torsten
Torsten 2018 年 5 月 14 日
Use "fmincon" with the bound constraints x>=0 and x<=20.

サインインしてコメントする。

 採用された回答

Torsten
Torsten 2018 年 5 月 14 日

0 投票

x1=0;
x2=20;
fun=@(x)x^2+2x-3;
x = fminbnd(fun,x1,x2)

その他の回答 (0 件)

カテゴリ

質問済み:

2018 年 5 月 14 日

コメント済み:

2018 年 5 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by