📄 go_rand_.m
字号:
global OPT_METHOD % optimization methodOPT_METHOD = 'simplex'; % this is used in peaksfcn.m global PREV_PT % previous data pointvar_n = 2; % Number of input variablesrange = [-3, 3; -3, 3]; % Range of the input variables% Plot contours of peaks function[x, y, z] = peaks;pcolor(x,y,z); shading interp; hold on;contour(x, y, z, 20, 'r');hold off; colormap(gray);colormap(flipud(colormap)); % flip colormapaxis square; xlabel('X'); ylabel('Y');drawnow;fcn = 'peaksfcn';%delete(findobj(gcf, 'tag', 'currpt'));PREV_PT = [];x = randsrch(fcn, [2, -2], range);line(x(1), x(2), 'linestyle', 'x', 'markersize', 10, ... 'clipping', 'off', 'erase', 'none', ... 'color', 'c', 'tag', 'member');PREV_PT = [];x = randsrch(fcn, [-1, -1], range);line(x(1), x(2), 'linestyle', 'x', 'markersize', 10, ... 'clipping', 'off', 'erase', 'none', ... 'color', 'c', 'tag', 'member');PREV_PT = [];x = randsrch(fcn, [0, 1], range);line(x(1), x(2), 'linestyle', 'x', 'markersize', 10, ... 'clipping', 'off', 'erase', 'none', ... 'color', 'c', 'tag', 'member');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -