plot(X,Y,Z​,Data(temp​erature))

9 次查看(过去 30 天)
Swapnil Rane
Swapnil Rane 2018-4-25
How can I plot the spatial points in matlab for the temperature? the file is -- X,Y,Z,temperature
  2 个评论
Walter Roberson
Walter Roberson 2018-4-25
Do your X and Y form a regular grid, with one Z for each X and Y combination, and a temperature associated with that X, Y, Z ? This is the easiest of the situations.
Are your X and Y scattered, with only one Z for any given X, Y combination, and a temperature associated with that X, Y, Z? This is not difficult but a bit more work than the first possibility.
Do your X, Y, Z form a volume? If so is it a regular volume like a cuboid? The difficulty of volume work depends upon the kind of plot needed.
Do your X, Y, Z just form a point cloud? This can be the most difficult to get useful plots out of.

请先登录,再进行评论。

回答(2 个)

Walter Roberson
Walter Roberson 2018-4-25
In the case of rectangular grids of X, Y, with a Z corresponding, and a temperature for each location, then the easiest way is to reshape() the X, Y, Z, Temperature into 2D arrays so that the unique values of the X occupy either the rows or the columns, and the Y have the unique values going in the other direction. Once you have that arrangement, then
surf(xgrid, ygrid, zgrid, temperaturegrid)
  4 个评论
Adalric Leung
Adalric Leung 2020-7-4
Sorry, I'm still learning how to use Matlab, but I have a 4-D matrix that contains temperature values in x y and z, as well as a function of time. My main objective is to be able to plot an animation of the 3D temperature values in x y and z as my time variable increases, but my first step would be to learn how to plot the temperature in three dimensions.
This may be redundant, but essentially I'm trying to plot my discrete values of temperature in a 3D graph.
Here's a link to my question with more detail:
Adalric Leung
Adalric Leung 2020-7-4
Thank you in advance for your help!

请先登录,再进行评论。


Image Analyst
Image Analyst 2018-4-25
Another way is to use scatter3() and adjust the color and/or size of the marker depending on the temperature of the 3-D point. This would not be good though if you had a solid volume, like every possibility of x, y, and z has a temperature. If you have that, you might try the Volume Viewer app on the Apps tab of the tool ribbon, if you have the Image Processing Toolbox. Or you can view slices through the volume with slice() for older versions of MATLAB.

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by