how to generate waveform graph?

Can anyone help me generate code to produce this waveform graph? This is wave equation that using finite difference method. Thank you very much for helping..

 Accepted Answer

Here is a simple script that will plot the function sin(L*x). Perhaps you can adapt it to plot your function u(x,t):
L = 0.5;
x = 0 : 0.1 : 60;
u = sin(L*x);
figure
plot(x,u)

1 Comment

Thank you, i get the idea, but how to apply finite difference method into this code? thanks for your help~

Sign in to comment.

More Answers (0)

Tags

Asked:

on 21 Apr 2014

Commented:

on 22 Apr 2014

Community Treasure Hunt

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

Start Hunting!