How to plot 3D surface with the given points in excel

4 次查看(过去 30 天)
Hello,
Does anybody know h ow can we plot 3D surface for points in 3 columns as a vector? I have 3 different 20 by 1 vectors and I want to get 3D plot. Two first are input and next output.
Thanks

采纳的回答

KSSV
KSSV 2022-3-11
T = readtable(myexcelfile) ;
x = T.(1) ; y = T.(2) ; z = T.(3) ;
%%structured
xi = unique(x) ; yi = unique(y) ;
[X,Y] = meshgrid(xi,yi) ;
Z = reshape(z,size(X)) ;
figure
surf(X,Y,Z)
%%unstructured
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
figure
trisurf(tri,x,y,z)
  7 个评论
Torkan
Torkan 2022-3-14
I used also this one to make it smooth
f = fit([x y],z,"poly23");
plot(f,[x y],z);
But the issue is for some of the data the vertical axis range is too high? Would you please check it and let me know what can I do?
x = [0.333;
0.333;
0.333;
0.2727;
0.2727;
0.2727;
0.2;
0.2;
0.2];
y= [525;
550;
500;
500;
525;
550;
500;
525;
550];
z1= [-74.6;
-21.788;
-125.444;
-124.603;
-71.143;
-17.073;
-107.754;
-52.662;
2.7513];
f = fit([x y],z,"poly23");
plot(f,[x y],z);
c = jet(20);
colormap(c);
shading interp
By the way in matlab 2022 this function does not wok

请先登录,再进行评论。

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by