% % triangle.m Demonstrating the loop and % graphics interaction % function triangle_opposite(len) % c=50; d=10; len=50; % length % x(1)=c; x(2)=x(1)+len/2; x(3)=x(2)-len; x(4)=x(1); %-------------------- y(1)=d; y(2)=y(1)+len*sin(pi/3); y(3)=y(2); y(4)=y(1); % % for j=1:3 line([x(j) x(j+1)],[y(j) y(j+1)]); text(x(j),y(j),num2str(j)); end % i