- #1

- 174

- 0

I need to plot a graph like the one below

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- MATLAB
- Thread starter JI567
- Start date

- #1

- 174

- 0

I need to plot a graph like the one below

- #2

jedishrfu

Mentor

- 12,654

- 6,526

- #3

- 174

- 0

Are you sure? I can't find anything related to wave equations in here...

- #4

jedishrfu

Mentor

- 12,654

- 6,526

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

- #5

- 174

- 0

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

Mark44

Mentor

- 34,825

- 6,568

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

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

Mark44

Mentor

- 34,825

- 6,568

Show us what you have tried.What do you want to see?

PDE? Partial differential equations?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.

- #9

DrClaude

Mentor

- 7,575

- 3,924

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

- #10

kreil

Gold Member

- 668

- 67

http://www.csun.edu/~jb715473/math450.html

Additionally, here are some more links that might be helpful:

https://www.google.com/url?sa=t&rct...0yKvIdMP3mf3gNvMg&sig2=tZZPGPNhATNbzCVMAH1Bbg

https://books.google.com/books?id=l...age&q=D'Alembert wave equation matlab&f=false

Share: