Форум для обсуждения курса

24.02.2024 МТ-402

24.02.2024 МТ-402

by Артем Маковецкий -
Number of replies: 0

points = [
#1
1 1;
1 4;
8 5;
10 2;
#2
-1 1;
-2 5;
-3 2;
-8 4;
#3
-2 -1;
-5 -2;
-1 -4;
-4 -6;
#4
1 -2;
12 -2;
11 -5;
2 -7];
hold on;
X = -10 : 0.1 : 14;
Y = -10 : 0.1 : 10;

plot(X, 0, 'k');
plot(0, Y, 'k');
for i = 1 : size(points)(1)
if points(i, 1) > 0 && points(i, 2) > 0
plot(points(i, 1), points(i, 2), 'r*');
elseif points(i, 1) > 0 && points(i, 2) < 0
plot(points(i, 1), points(i, 2), 'b*');
elseif points(i, 1) < 0 && points(i, 2) < 0
plot(points(i, 1), points(i, 2), 'g*');
else
plot(points(i, 1), points(i, 2), 'm*');
endif
endfor