how to plot a wave propagation using surface plot.
조회 수: 34 (최근 30일)
이전 댓글 표시
hi all, i m facing a problem to ploting a wave function in 3d plot or surface or contour plot.i ploteed that wave in 2d. the coding for that i used is f=1.0e6; fs=f*100; n=3; t=0:1/fs:n/f; y=15*(1-cos(2*pi*f*t/n)).*sin(2*pi*f*t); plot(t,y); ylabel('amplitude'); xlabel('time'); now i have to plot this function as surface plot or counter plot.how i can do this????????
댓글 수: 0
채택된 답변
Dishant Arora
2012년 9월 4일
you can add phase angle to get the desired result.
f=1.0e6;
n=3;
t=linspace(0,f,100);
phi=linspace(-pi,pi,100);
y=15*(1-cos(2*pi*f*t/n+phi)).*sin(2*pi*f*t+phi);
plot3(t,phi,y);
figure(2)
[T Phi]=meshgrid(t,phi);
Y=15*(1-cos(2*pi*f*T/n+Phi)).*sin(2*pi*f*T+Phi);
surf(T,Phi,Y);
댓글 수: 0
추가 답변 (1개)
Dishant Arora
2012년 9월 1일
f=1.0e6;
fs=f*100;
n=3;
t=0:1/fs:n/f;
T=meshgrid(t);
y=15*(1-cos(2*pi*f*T/n)).*sin(2*pi*f*T);
surf(T,y);
ylabel('amplitude');
xlabel('time');
댓글 수: 5
Dishant Arora
2012년 9월 3일
well, i am not getting what you want. btw, check out the following link. http://www.mathworks.com/matlabcentral/fileexchange/35305-matlab-plot-gallery-surface-plot-1/content/html/Surface_Plot_1.html
may be you are looking for this kinda plot.
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!