MATLAB Answers

need help to plot a mesh

조회 수: 3(최근 30일)
Muhammad Usman
Muhammad Usman 8 Jan 2020
답변: Rik 8 Jan 2020
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

  댓글 수: 0

로그인 to comment.

답변(1개)

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

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by