How to surfplot from xyz coordinates?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Use surf to plot the following points:
(1, 1, 1), (2, 1, 2), (3, 1, 3)
(1.1, 2, 4), (2.2, 2, 5), (3.3, 2, 4)
(1.2,3,3), (2.4, 3, 2), (3.6, 3, 1)
0 Kommentare
Akzeptierte Antwort
KSSV
am 30 Jan. 2019
A = [1, 1, 1
2, 1, 2
3, 1, 3
1.1, 2, 4
2.2, 2, 5
3.3, 2, 4
1.2,3,3
2.4, 3,2
3.6, 3, 1] ;
x = A(:,1); y = A(:,2) ; z = A(:,3) ;
dt = delaunayTriangulation(x,y) ;
tri = dt.ConnectivityList ;
trisurf(tri,x,y,z)
2 Kommentare
KSSV
am 30 Jan. 2019
A = [1, 1, 1
2, 1, 2
3, 1, 3
1.1, 2, 4
2.2, 2, 5
3.3, 2, 4
1.2,3,3
2.4, 3,2
3.6, 3, 1] ;
x = A(:,1); y = A(:,2) ; z = A(:,3) ;
m = 10 ; n = 10 ;
xi = linspace(min(x),max(x),m) ;
yi = linspace(min(y),max(y),n) ;
[X,Y] = meshgrid(xi,yi) ;
F = scatteredInterpolant(x,y,z) ;
Z = F(X,Y) ;
surf(X,Y,Z) ;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!