3 vector to surface 3d plot?

16 Ansichten (letzte 30 Tage)
Le Xuan Thang
Le Xuan Thang am 23 Mai 2022
Kommentiert: Le Xuan Thang am 23 Mai 2022
I have 3 vector have coordinate of 3 edge of triangle. How can I plot i in Mesh, or surface by 3D plot?
This is example: matrix f has 3 vector:
f = [0 0 288
0 28.8 259.2
0 57.6 230.4
0 86.4 201.6
0 115.2 172.8
0 144 144
0 172.8 115.2
0 201.6 86.4
0 230.4 57.6
0 259.2 28.8
0 288 0]
and figure I want to plot is:

Antworten (1)

KSSV
KSSV am 23 Mai 2022
  1 Kommentar
Le Xuan Thang
Le Xuan Thang am 23 Mai 2022
thank you for your answer. If you use f matrix I post above. You can see that 3 column is 3 edge of triangle. I tried you refer link and it s have error. Can you explain to me why? This is code i use
x = f(:,1) ; y = f(:,2) ; z = f(:,3) ;
% %%structured
xi = 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)
And this is error i have.
Error using reshape
To RESHAPE the number of elements must not change.
Error in test1 (line 19)
Z = reshape(z,size(X)) ;

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by