Plotting a Matrix within an X,Y range

1 reply · 4K views · last reply
Link-
Messages
99
Reaction score
0
Hi guys...

Here's the problem. I want to plot a Temperature T(x,y) profile across a plate with dimensions L x W. I'm using finite difference method so the temperature are only known at the nodes I choose, if I make n nodes across the Length and m nodes across the Width I will end up with an n x m matrix or n*m x 1 matrix. The problem is that I want to assign each known Temperature of the nodes to its respect point in the plate across the x-y plane.

Is not a plotting command problem, I used surf(T) or mesh(T) and I end up with a plot that have the temperature profile but the x-axis goes from 0 to n and the y from 0 to m and not LxW. The temperature is not in it's corresponding x,y point.

Any help?
Thanks in advance.
 
You need to learn to read the documentation. From MATLAB's help:

mesh(X,Y,Z) draws a wireframe mesh with color determined by Z so color is proportional to surface height. If X and Y are vectors, length(X) = n and length(Y) = m, where [m,n] = size(Z). In this case, (X(j), Y(i), Z(i,j)) are the intersections of the wireframe grid lines; X and Y correspond to the columns and rows of Z, respectively. If X and Y are matrices, (X(i,j), Y(i,j), Z(i,j)) are the intersections of the wireframe grid lines.

- Warren