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

10.02.22 МТ-402

10.02.22 МТ-402

by Ruslan Nurgatin -
Number of replies: 0

<pre>
# P1=(2,3)
# P2=(4,1)
# P3=(4,4)
# P4=(5,3)
# P5=(6,4)

points = [2,3;
4,1;
4,4;
5,3;
6,4];

# disp(points);

h = size(points)(1); # = 5
w = size(points)(2); # = 2
# disp([h,w]);

X = [];
for i=1:h
for j=1:2
if (j == 1)
X(i,j) = 1;
else
X(i,j) = points(i,1);
endif;
endfor;
endfor;

disp(X);
Y = [];

for i=1:h
Y(i) = points(i,2);
endfor;
disp(Y');

plot(points(:,1), points(:,2),"markersize",15, ".");
</pre>