Reputation: 1865
I have the following code :
a=7
f=10
T=1/f;
v=40
wl=v/f;
x1=1;
x2=30
step=0.01
t=x1:step:x2;
x=x1:step:x2;
y=a*sind(2*pi*f*(t+(x*T)/wl));
h=plot(x,y);
I tried h=plot3(x,y,t)
but the line itself remains in 2D .. Should I convert this into a matrix ?
Upvotes: 0
Views: 204
Reputation: 10676
Create a grid of points and then use mesh()
:
[x,t] = meshgrid(x,t);
y = a*sind(2*pi*f*(t+(x*T)/wl));
mesh(y)
Upvotes: 1