我正在尝试重现Dirac Delta功能:
我的代码:
x = -30:1:30; y = zeros(1,numel(x)); %sets all values initially to zero y(x==0)= inf; % the point corresponding to x=0 is set to inf plot(x,y,'d') axis([-40 40 0 inf])
我的代码产生:
matlab plot matlab-figure
matlab ×1
matlab-figure ×1
plot ×1