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

  • MATLAB
  • Thread starter JI567
  • Start date
  • #1
174
0

Main Question or Discussion Point

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
 

Answers and Replies

  • #4
11,487
5,017
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.
 
  • #5
174
0
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
 
  • #6
33,265
4,965
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...
 
  • #7
174
0
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.
 
  • #8
33,265
4,965
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?
 
  • #9
DrClaude
Mentor
7,148
3,281
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.
 
  • #10

Related Threads on Help please in matlab -- plotting a D'Alembert wave equation

  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
2
Views
6K
Replies
2
Views
9K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
0
Views
1K
  • Last Post
Replies
3
Views
8K
Replies
1
Views
2K
Replies
6
Views
5K
  • Last Post
Replies
1
Views
4K
Replies
2
Views
2K
Top