How to a plot a surface from excel sheet XYZ

13 次查看(过去 30 天)
I have an excel sheet (attached) and I want to plot a smooth XYZ surface from this data.
IMPORTANT NOTE:
Originally, both X & Y go from 0 to 0.5. However, some points were outliers and I needed to remove them, so I ended up with this data.
This is a screenshot:

采纳的回答

KSSV
KSSV 2021-11-6
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/791474/excel-surface.xlsx')
T = 2401×3 table
X Y Z ____ ____ ____ 0 0 1.5 0.01 0 1.52 0 0.01 1.52 0.01 0.01 1.55 0.02 0 1.57 0.01 0.02 1.6 0.02 0.01 1.64 0 0.02 1.64 0.02 0.02 1.67 0.03 0 1.69 0.03 0.01 1.74 0.02 0.03 1.76 0.01 0.03 1.81 0 0.03 1.82 0.04 0.01 1.85 0.03 0.02 1.85
x = T.(1) ;
y = T.(2) ;
z = T.(3) ;
xi = linspace(min(x),max(x));
yi = linspace(min(y),max(y)) ;
[X,Y] = meshgrid(xi,yi) ;
Z = griddata(x,y,z,X,Y) ;
pcolor(X,Y,Z)
shading interp
colorbar

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by