Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用在 Matlab 中绘制 Dirac delta 函数plot,但我在图中看不到任何内容。我如何可视化它?
plot
x = -10 : 0.1 : 10; y = double(x == 0); plot(x, y);
或者
stem(x, y);
我个人更喜欢使用dirac和设置Inf到1或其他幅度。
dirac
Inf
1
x = -1:0.1:1; y = dirac(x); idx = y == Inf; % find Inf y(idx) = 1; % set Inf to some amplitude stem(x,y)
当然,另一个答案是完全有效的。这只是个人对明确的偏好。