3.1 引导
【 * 例 3.1-1 】 绘制函数 在 时的曲线。
x=0:0.1:1 % 定义自变量的采样点取值数组
y=x.*exp(-x) % 利用数组运算计算各自变量采样点上的函数值
plot(x,y),xlabel('x'),ylabel('y'),title('y=x*exp(-x)') % 绘图
x =
Columns 1 through 7
0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000
Columns 8 through 11
0.7000 0.8000 0.9000 1.0000
y =
Columns 1 through 7
0 0.0905 0.1637 0.2222 0.2681 0.3033 0.3293
Columns 8 through 11
0.3476 0.3595 0.3659 0.3679

图 3.1-1