% % plot_loop.m Demonstrating the loop and % graphics interaction % x=[0 100 100 0 0]; y=[0 0 100 100 0]; h=figure; set(gcf,'DefaultTextColor','red'); plot(x,y, 'g-'); title('First loop test'); x0=[10 20]; y0=[10 20]; i=1; %for i=1:4 x1=x0+(i-1)*[10,10]; y1=y0; line(x1,y1); text(x1(1),y1(1),num2str(i)); %end