x = 1:10;
n = randn(size(x));
x1 = x + n;
x2 = x./n;
plot(x,x,x,x1,x,x2);
leg1 = legend('$\bar{x}$','$\tilde{x}$','$\hat{x}$');
set(leg1,'Interpreter','latex');
set(leg1,'FontSize',17);
set(gcf,'color','w');
Giải: Sau khi thực hiện các dòng lệnh trên. Chúng ta có:
x = 1:10;
n = randn(size(x));
x1 = x + n;
x2 = x./n;
plot(x,x,x,x1,x,x2);
leg1 = legend('$\bar{x}$','$\tilde{x}$','$\hat{x}$');
set(leg1,'Interpreter','latex');
set(leg1,'FontSize',17);
set(gcf,'color','w');