MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   Matlab Countour Plot with trace (https://www.labfans.com/bbs/showthread.php?t=22167)

poster 2019-11-26 22:23

Matlab Countour Plot with trace
 
<p>How can I plot the following data onto a contour instead?</p>

<pre><code>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
</code></pre>

<p>I would like to plot the point (a,b) for which the function is minimum on a contour tracing convergence towards the center. </p>



[url=https://stackoverflow.com/questions/59053030/matlab-countour-plot-with-trace]More answer...[/url]


所有时间均为北京时间。现在的时间是 19:46

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.