plotnum.m

来自「王小平《遗传算法——理论、应用与软件实现》随书光盘」· M 代码 · 共 22 行

M
22
字号
function plotnum(x,y,h)
%
% plotnum(x,y,h)
%
% plots two x & y vectors using the
% sample number as the indicator rather
% than the usual crappy cross, on the
% axes with handle h
%

[D L]=size(x);
mnx=min(x);
mxx=max(x);
mny=min(y);
mxy=max(y);
axes(h);
for i = 1:D
	text(x(i),y(i),num2str(i));
end
set(h,'Xlim',[mnx mxx],'Ylim',[mny mxy]);
drawnow;

⌨️ 快捷键说明

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