Giải: Chúng ta thực hiện lệnh như sau:
X = 5*rand(100,1);
Y = rand*X + rand(100,1);
figure(1);
plot(X,Y,'o','MarkerEdgeColor','k',...
'MarkerFaceColor','r',...
'MarkerSize',8);
xlabel('X = 5*rand(100,1)')
ylabel('Y = rand*X + rand(100,1)');
title('Do thi ve Y theo X dùng hàm plot()');