0% found this document useful (0 votes)
3 views

Plot the Final Point

The document describes the process of plotting a final point in a 3D space using the 'plot3' function and adding a legend to the plot. It also discusses perturbing an objective function by introducing random noise and visualizing the stochastic objective function with specific camera settings. The objective function is smoothed using a defined handle and displayed in a figure.

Uploaded by

milad.gholamifar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Plot the Final Point

The document describes the process of plotting a final point in a 3D space using the 'plot3' function and adding a legend to the plot. It also discusses perturbing an objective function by introducing random noise and visualizing the stochastic objective function with specific camera settings. The objective function is smoothed using a defined handle and displayed in a figure.

Uploaded by

milad.gholamifar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Plot the final point

Get
ph(2) = plot3(Xop(1),Xop(2),Fop,'dm','MarkerSize',10,'MarkerFaceColor','m');
% Add a legend to plot
legendLabels = [legendLabels, '|fmincon| solution'];
lh = legend(ph,legendLabels,'Location','SouthEast');
lp = lh.Position;
lh.Position = [1-lp(3)-0.005 0.005 lp(3) lp(4)];
hold off;
Stochastic Objective Function
Now perturb the objective function by adding random noise.
Get
rng(0,'twister') % Reset the global random number generator
peaknoise = 4.5;
Objfcn = @(x) smoothFcn(x,peaknoise); % Handle to the objective function.
% Plot the objective function (non-smooth)
fig = figure('Color','w');
showSmoothFcn(Objfcn,range);
title('Stochastic objective function')
ax = gca;
ax.CameraPosition = [-31.0391 -85.2792 -281.4265];
ax.CameraTarget = [0 0 -50];
ax.CameraViewAngle = 6.7937;

You might also like