已知一条线左端的坐标为-100400右端坐标为500400点A02-600200点A05200500垃圾箱1坐标:-100400垃圾箱2坐标:200400用matlab代码画出这条线和A02A05以及两个垃圾桶的位置另外这条线的两个端点也有垃圾桶都用matlab以点的形式表示出来。
% 绘制坐标系
figure;
hold on;
axis([-700, 600, 0, 600]);
plot([-700, 600], [0, 0], 'k');
plot([0, 0], [0, 600], 'k');
% 绘制线和垃圾桶
plot([-100, 500], [400, 400], 'b'); % 线
plot(-100, 400, 'ro'); % 左端垃圾桶
plot(500, 400, 'ro'); % 右端垃圾桶
plot(-600, 200, 'g*'); % A02
plot(200, 500, 'g*'); % A05
plot(-100, 400, 'r*'); % 垃圾箱1
plot(200, 400, 'r*'); % 垃圾箱2
原文地址: https://www.cveoy.top/t/topic/flL9 著作权归作者所有。请勿转载和采集!