finding max points of an inline function?

hi i need to find max x and y points of the inline(y-x-2*x^2-2*x*y-y^2 ). can you help please?

 採用された回答

Sean de Wolski
Sean de Wolski 2014 年 12 月 23 日

0 投票

First, don't use inline, it's been deprecated; use anonymous functions instead. Next, use fminsearch to find the minimum of the negative of the function.
% x(1) is y, x(2), is x
f = @(x)x(1)-x(2)-2*x(2)^2-2*x(2)*x(1)-x(1)^2
f =
@(x)x(1)-x(2)-2*x(2)^2-2*x(2)*x(1)-x(1)^2
fminsearch(@(x)-f(x),rand(1,2))
ans =
1.5000 -1.0000

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFunction Creation についてさらに検索

タグ

質問済み:

2014 年 12 月 23 日

コメント済み:

2014 年 12 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by