Hi everyone.(adsbygoogle = window.adsbygoogle || []).push({});

So, I have a quantity I am computing, say w, a vector. Now w is a function of time t and space x. I have the vectors x and t. At each time step in a loop, I calculate w for that time step. How do I plot w as a 3D plot, as a function of time t and space x, so I can see the evolution of the system?

Here's what I tried. I created a matrix A of dimension NxM, where N is the length of the vector x, and M the length of the vector t. At the mth time step I placed the computed value of w in the mth column of A. Then I tried to plot it like this:

>> plot3(t,x,A)

but that doesn't work, instead I tried t.*x, x.*t in all combinations, but nothing worked. What is the correct way to do it?

Thanks.

**Physics Forums - The Fusion of Science and Community**

# 3D Plot in Matlab

Know someone interested in this topic? Share a link to this question via email,
Google+,
Twitter, or
Facebook

- Similar discussions for: 3D Plot in Matlab

Loading...

**Physics Forums - The Fusion of Science and Community**