plotcorana.m

来自「遗传算法的MATLAB代码」· M 代码 · 共 27 行

M
27
字号
function [z, a] = coranaEval(per)i=0;a=-0.9:per:0.9;sz=size(a,2);z=zeros(sz,sz);for x=a  i=i+1; j=0;  for y=a    j=j+1;    z(i,j)=coranaFeval([x y]);  endend%Done!%First let's look at it in each dimension independentlyclgplot(z(:,1)) %Plot a slice of the function in x max 250.25%Notice the range is [250.0-250.25]pause %Strike any key to continueclgplot(z(1,:)) %Plot a slice of the function in y %Notice the range is [0-250]pause %Strike any key to continuemesh(a,a,z);view(30,60);grid;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?