フィルターのクリア

Contour Plot with trace

4 ビュー (過去 30 日間)
jojo
jojo 2019 年 11 月 26 日
コメント済み: jojo 2019 年 11 月 26 日
How can I plot the following data onto a contour instead?
close all;
clear all;
clc;
syms x
f=@(x) -100.*(x(2)-x(1).^2).^2+ (1-x(1)).^2;
x0=[-9, 1];
options=optimset('display', 'iter', 'TolX',1e-6);
%options = optimset('PlotFcns',@optimplotfval);
x=fminsearch(f, x0, options)
a= %need help pulling this from fminsearch [a,b,c]=fminsearch(f,x0,options] ???
b=%need help pulling this from fminsearch
fcontour(f, 'Fill', 'On');
hold on;
plot(a,b,'*-r');
xlim([-50 50]);
ylim([0 45]);plot
I would like to plot the point (a,b) for which the function is minimum on a contour tracing convergence towards the center.
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 11 月 26 日
y?
jojo
jojo 2019 年 11 月 26 日
Updated post. I meant (a,b). y would be x(2) in the function handle definition. Thanks for bringing it to my attention.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by