MATLAB Help please in matlab -- plotting a D'Alembert wave equation

AI Thread Summary
The discussion centers on plotting a D'Alembert wave equation solution in MATLAB, with the original poster expressing confusion about generating the necessary data for the plot. They mention attempts to define x and y values but are not achieving the desired results. Other participants suggest that the poster needs to provide examples of their attempts for more effective assistance and emphasize that they should not expect others to do the work for them. There are recommendations for additional tutorials and resources, including links to helpful materials on MATLAB plotting and PDE commands. A specific suggestion is made to create multiple points at specific x-values to achieve straight vertical lines in the graph. Overall, the conversation highlights the need for clarity in data generation and the importance of sharing progress for better guidance.
JI567
Messages
173
Reaction score
0
Can someone please help me in plotting a D'Alembert wave equation solution in MATLAB? I am so confused as how to plot it in MATLAB

I need to plot a graph like the one below

upload_2015-1-6_7-24-35.png
 
Physics news on Phys.org
It talks about plotting multiple lines.

If you're looking for more info like generating the data for plot then you'll need to find another tutorial.
 
jedishrfu said:
It talks about plotting multiple lines.

If you're looking for more info like generating the data for plot then you'll need to find another tutorial.

No man I already know how to plot multiple lines...its on how to generate the data actually
 
JI567 said:
No man I already know how to plot multiple lines...its on how to generate the data actually
Show us what you have already tried. Be advised, however, that we're not going to do your work for you...
 
Mark44 said:
Show us what you have already tried. Be advised, however, that we're not going to do your work for you...

What do you want to see? I have typed all sorts of commands in MATLAB getting nothing as a result so I have nothing to show you.

I tried x = [-1 -0.5 0 0.5...4] then did y = [0,0,0 placed 2 for all the x values in the picture that had y as 2] then did plot(x,y) but got some stupid graph

anyways I don't know how to use PDE commands in MATLAB unless someone wants to be generous and teach me...I am good at coding and maths I swear! I will learn fast.
 
JI567 said:
What do you want to see?
Show us what you have tried.
JI567 said:
I have typed all sorts of commands in MATLAB getting nothing as a result so I have nothing to show you.

I tried x = [-1 -0.5 0 0.5...4] then did y = [0,0,0 placed 2 for all the x values in the picture that had y as 2] then did plot(x,y) but got some stupid graph

anyways I don't know how to use PDE commands in MATLAB unless someone wants to be generous and teach me...I am good at coding and maths I swear! I will learn fast.
PDE? Partial differential equations?
 
JI567 said:
I tried x = [-1 -0.5 0 0.5...4] then did y = [0,0,0 placed 2 for all the x values in the picture that had y as 2] then did plot(x,y) but got some stupid graph
To get straigth veritcal lines (by hand), you need to double the points at which the lines appear. For instance, you need two points at x = 0.5, one with y=0 followed by one with y=2.
 

Similar threads

Replies
4
Views
4K
Replies
1
Views
2K
Replies
5
Views
2K
Replies
4
Views
2K
Replies
32
Views
4K
Replies
5
Views
3K
Replies
1
Views
3K
Replies
1
Views
2K
Back
Top