2 dimensional plot problem

Hi,
I have written a program for a Crank-Nicolson scheme using MATLAB. I have solutions for u(x,t) at x=0:0.1:1.0, at t intervals of 0, 0.005, 0.001, 0.015 and 0.02.
We have the exact solution available, and are required to plot the difference between the exact and calculated values of u(x,t) with respect to x and t.
I am not sure how to do this, any help would be much appreciated.

回答(1 个)

the cyclist
the cyclist 2013-4-27

0 个投票

My recommendation would be to go to the Plot Gallery: http://www.mathworks.com/discovery/gallery.html.
There you will find example of plots, along with the code that generates them. I expect you will be able to adapt one of them to your needs.

1 个评论

Hi, thanks for the answer.
The problem is, say I wanted to do a 3D bar plot, I currently have the u values, but I'm not sure how to specify the x and t values that they are at. For instance, I have a column matrix of 11 u values from x=0 to x=1 in intervals of 0.1, at time t=0, the same for time t=0.005, and so on, but I don't know how to plot this.
Many thanks.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Financial Toolbox 的更多信息

提问:

XJ
2013-4-27

Community Treasure Hunt

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

Start Hunting!

Translated by