how to plot a wave propagation using surface plot.

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????????

 採用された回答

Dishant Arora
Dishant Arora 2012 年 9 月 4 日

0 投票

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);

その他の回答 (1 件)

Dishant Arora
Dishant Arora 2012 年 9 月 1 日

0 投票

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 件のコメント

kavya saxena
kavya saxena 2012 年 9 月 1 日
hi thankx for reply...but it will not give a waveform. it gives a rectangular inclind plane, not like a wave propagation in surface. there is no such feeling of wave in it.plz give some more suggestion
Dishant Arora
Dishant Arora 2012 年 9 月 1 日
編集済み: Dishant Arora 2012 年 9 月 3 日
kavya saxena
kavya saxena 2012 年 9 月 3 日
i get this type of curve but i want the surface plot,as the wave pattern is shown on a surface or i can say in a plane.
Dishant Arora
Dishant Arora 2012 年 9 月 3 日
may be you are looking for this kinda plot.
kavya saxena
kavya saxena 2012 年 9 月 4 日
oh yes..i want this kind of curve, but using my function i m not getting this plot.in above there is three vatiable but in my case there is variation with time.so plz help me to make it....

サインインしてコメントする。

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by