How can I plot a mesh, surface or a contour from discrete vector data ?

Hello,
I would like to vizualize in Matlab a discrete thermal mesh made of 2200 discrete data: X, Y, Z, Temperature. The plot produced from the thermal simulation is showed below. I extracted the data in Matlab from an Excel file to put them in four vectors of size 2200.
I try to find out from the Matlab documentation the best way to plot an equivalent plot, for instance, the Temperature as a function of X and Y, for instance with the mesh, surf or contour function. The problem is that examples show only the use of the meshgrid before plotting.
I need to import and vizualize these data in Matlab because I want to cross-check them with another set of data placing elements on the map. Thereafter, I can identify in which temperature area these elements are located.
Is there any plotting function for my purpose or do I have to resize the temperature vector in a more or less complex way ?
Thanks for your suggestions.

 Accepted Answer

If your data is in vector form use griddata to create 3D array
x = linspace(min(X0(:)), max(X0(:)), 50);
y = linspace(min(Y0(:)), max(Y0(:)), 50);
z = linspace(min(Z0(:)), max(Z0(:)), 10);
[X,Y,Z] = meshgrid(x,y,z);
T = griddata(X0,Y0,Z0,T0,X,Y,Z);
slice(X,Y,Z,T,1,[],[]); % show temperatures at x=1
% isosurface(X,Y,Z,T,10) % show areas T=10
Read also about gradient, quiver3, interp3

2 Comments

Hello,
griddata fits perfectly with my needs. Thank you very much !
Accept the answer if it helped

Sign in to comment.

More Answers (0)

Products

Release

R2017b

Asked:

on 23 Sep 2019

Commented:

on 24 Sep 2019

Community Treasure Hunt

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

Start Hunting!