How to find data points from a 3D plotted graph in MATLAB

2 Ansichten (letzte 30 Tage)
abhinadan papnoi
abhinadan papnoi am 3 Jul. 2020
Kommentiert: darova am 5 Jul. 2020
i have plotted a 3D bezier surface, i need to find values of Y for particular values of X and Z. how do i find it. Please hlep me its urgent.
here is my program
Bx=[0 0;20 20;40 40;50 50;70 70;80 80;100 100];
By=[2.181 2.3;1.909 1.821;1.324 1.6; 1.168 1.5;1.85 1.646; 4.2 2.415; 5 3.112];
Bz=[0.4 0.2;0.4 0.2;0.4 0.2;0.4 0.2;0.4 0.2;0.4 0.2;0.4 0.2];
N = [1 -6 15 -20 15 -6 1; -6 30 -60 60 -30 6 0; 15 -60 90 -60 15 0 0; -20 60 -60 20 0 0 0; 15 -30 15 0 0 0 0; -6 6 0 0 0 0 0; 1 0 0 0 0 0 0];
M = [-1 1; 1 0];
i=1;
for u= linspace(0,1)
for v= linspace(0,1)
U=[u^6,u^5,u^4,u^3,u^2,u,1];
V=[v,1];
x(i)= U*N*Bx*M'*V';
y(i)= U*N*By*M'*V';
z(i)= U*N*Bz*M'*V';
i=i+1;
end
end
plot3(x,y,z)

Akzeptierte Antwort

darova
darova am 3 Jul. 2020
use griddata
y1 = griddata(X,Z,Y,x1,z1);
  2 Kommentare
abhinadan papnoi
abhinadan papnoi am 5 Jul. 2020
Thank you so much brother, it worked perfectly. You saved me.
darova
darova am 5 Jul. 2020
im jsut doing my job

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

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

Tags

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by