MATLAB Answers

contour plot for 3d data with x, y, z and c in matlab

3 views (last 30 days)
Hongxia Hao
Hongxia Hao on 16 Jan 2020
Commented: KSSV on 16 Jan 2020
I have data in X, Y, Z, C format where all are 3d matrix, and C is the amplitude of the measurement at coordinate (X,Y,Z). I'd like to show this data as a contour plot where the contour color represents the value C(amplitude). How may I do that in matlab?
The X,Y,Z data are generated from meshgrid.
xi=linspace(1,5,50);
yi=linspace(1,5,50);
zi=linspace(1,5,50);
[X, Y, Z]=meshgrid(xi,yi,zi);
C = griddata(x,y,z,v,X,Y,Z,'natural');

  0 Comments

Sign in to comment.

Answers (1)

KSSV
KSSV on 16 Jan 2020
Read abouit contour3, slice.

  2 Comments

Hongxia Hao
Hongxia Hao on 16 Jan 2020
I don't thinke either of contour3 or slice works. contour3 can only work on 2d arrays, where mine is 3d array. slice you have to define the slice location, however I want to show the whole surface.

Sign in to comment.

Sign in to answer this question.


Translated by