这个图应该这样吗?

时间:2019-06-22 10:26:47

标签: matlab

enter image description here

我们有此连续信号:

x(t)=cos(100*pi*t)+cos(200*pi*t)+sin(500*pi*t)  

我们需要做的是对其进行采样,然后对其进行重构。我们是在Matlab中制作出来的,但看起来像一个盒子,我们想知道这是否应该是它的外观。

x = @(t) cos(100*pi*t)+cos(200*pi*t)+sin(500*pi*t);
t = -10:1/1000:10;
figure(1);
plot(t, x(t));
grid;

1 个答案:

答案 0 :(得分:1)

我在MATLAB上重新创建了图,是的,我看到了相同的“盒子”行为。值得注意的是,用[-10 10]的域在Desmos上绘制函数图也显示了类似的“框”。

我认为问题是由您对域([-10 10])的选择引起的,该域使函数显示为“框”。例如,将大小调整为以下域([-0.05 0.05]

t = -0.05: 1/10000: 0.05;

产生更清晰的图:

plot produced with x domain of -0.05 to 0.05, the function no longer appears as a box and can be more clearly viewed