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

11 vues (au cours des 30 derniers jours)
Swapnil Rane
Swapnil Rane le 25 Avr 2018
Commenté : Adalric Leung le 4 Juil 2020
How can I plot the spatial points in matlab for the temperature? the file is -- X,Y,Z,temperature
  2 commentaires
Walter Roberson
Walter Roberson le 25 Avr 2018
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.
Swapnil Rane
Swapnil Rane le 25 Avr 2018
the first one

Connectez-vous pour commenter.

Réponses (2)

Walter Roberson
Walter Roberson le 25 Avr 2018
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 commentaires
Adalric Leung
Adalric Leung le 4 Juil 2020
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 le 4 Juil 2020
Thank you in advance for your help!

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 25 Avr 2018
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.
  1 commentaire
Image Analyst
Image Analyst le 25 Avr 2018
Or use a true volume rendering program like Avizo: https://www.fei.com/software/avizo-3d/

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by