need help to plot a mesh

2 ビュー (過去 30 日間)
Muhammad Usman
Muhammad Usman 2020 年 1 月 8 日
回答済み: Rik 2020 年 1 月 8 日
I just want to mesh plot a dirac delta function, can somebody help me to do so.
I wrote some lines of code to plot dirac delta function, but i need mesh or surf plot. Given below is my code:
x = linspace(-8,8,1000);
alpha = [0.1,0.5,2.5,5];
for i = alpha(1):alpha(end)
del = ((4*i*pi).^(-1/2)).*exp((-x.^2)./(4*i));
plot(x,del)
hold on;
end
Thanks

回答 (1 件)

Rik
Rik 2020 年 1 月 8 日
Use meshgrid to generate the full grid of combinations of x and alpha. Then you can use the surf function.

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by