1、h = gobjects(1,500);
通过这个函数可以生成的数组矩阵。共有1行,500列。

2、p = zeros(500,3);
生成500行,3列这样的一个0矩阵。

3、for ix = 1:500
h(ix) = text(ix/500,ix/500,num2str(ix));
end
drawnow
ix,起始点为1,终点为500,步进默认为1。
for,循环。


4、% Get and save property values
for ix=1:500
pos = get(h(ix),'Position');
ext = get(h(ix),'Extent');
p(ix,:) = [pos(1)+(ext(3)+ext(1)), ...
pos(2)+ext(2)+ext(4),0];
end
%v=get(h,propertyName)返回特定属性propertyName的值。在属性名周围使用单引号,例如get(h,'Color')。如果不指定输出参数,则MATLAB将在屏幕上显示信息。

5、% Set the property values and
% call a drawnow after the loop
for ix=1:500
set(h(ix),'Position',p(ix,:));
end
drawnow