x1=1
y1=3
x2=3
y2=4
x3=2
y3=5
sum=0
x=zeros(1,5050)
y=zeros(1,5050)
for i=1:1:100
for j=0:1:100-i
for k=0:1:100-i-j
if i~=100 | j~=100 | k~=100
if i+j+k==100
sum=sum+1
x(sum)=i/100*x1+j/100*x2+k/100*x3
y(sum)=i/100*y1+j/100*y2+k/100*y3
end
end
end
end
end
figure()
hold on
scatter(x, y, '.')
x1=[x1,x2,x3]
y1=[y1,y2,y3]
gscatter(x1(1,:), y1(1,:),[1,2,3])
在一张图上画不同图线
标签:end,sum,matlab,y1,100,x1,y3 From: https://www.cnblogs.com/hahaah/p/17539413.html