Borrar filtros
Borrar filtros

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

6 visualizaciones (últimos 30 días)
Torkan
Torkan el 11 de Mzo. de 2022
Comentada: Torkan el 14 de Mzo. de 2022
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

Respuesta aceptada

KSSV
KSSV el 11 de Mzo. de 2022
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 comentarios
KSSV
KSSV el 12 de Mzo. de 2022
Read about colormap.
Torkan
Torkan el 14 de Mzo. de 2022
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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Spline Postprocessing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by