Plotting a Matrix within an X,Y range

Click For Summary
SUMMARY

The discussion focuses on plotting a temperature profile T(x,y) across a plate using MATLAB's finite difference method. The user encounters an issue where the temperature data is not correctly aligned with the physical dimensions of the plate, which are L x W. The solution involves using the mesh function in MATLAB, specifically mesh(X,Y,Z), where X and Y must be defined as vectors corresponding to the plate's dimensions, ensuring that the temperature data aligns with the correct x-y coordinates.

PREREQUISITES
  • Understanding of finite difference methods for temperature profiling
  • Familiarity with MATLAB programming and plotting functions
  • Knowledge of matrix dimensions and indexing in MATLAB
  • Ability to manipulate vectors and matrices for plotting
NEXT STEPS
  • Learn how to define vectors in MATLAB for mesh plotting
  • Explore MATLAB's documentation on the mesh and surf functions
  • Investigate finite difference methods for heat distribution analysis
  • Practice creating 3D plots with varying data sets in MATLAB
USEFUL FOR

Engineers, data scientists, and researchers involved in thermal analysis and visualization using MATLAB, particularly those working with finite difference methods for temperature distribution.

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.
 
Technology news on Phys.org
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
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
2
Views
2K
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
10K
  • · Replies 3 ·
Replies
3
Views
1K