Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

how to form a 3D surface with several points whose coordinate in x,y,z axis is known

1 visualizzazione (ultimi 30 giorni)
X = [0 5 0 5 2.5 0.417 2.5 4.58 0.417 2.5 4.58 2.5] Y = [0 0 5 5 0.154 1.668 1.698 1.668 3.33 3.30 3.33 4.845] Z = [0 2 2 0 1 0.68 1 1.3125 1.3125 1 1.6875 1] %% these are the coordinates given, i want to make surface using above coordinates thanks in advance

Risposte (1)

Star Strider
Star Strider il 18 Nov 2017
One approach (using griddata interpolation):
X = [0 5 0 5 2.5 0.417 2.5 4.58 0.417 2.5 4.58 2.5];
Y = [0 0 5 5 0.154 1.668 1.698 1.668 3.33 3.30 3.33 4.845];
Z = [0 2 2 0 1 0.68 1 1.3125 1.3125 1 1.6875 1];
Xq = linspace(min(X(:)), max(X(:)), 20);
Yq = linspace(min(Y(:)), max(Y(:)), 20);
[Xg,Yg] = meshgrid(Xq, Yq);
Zg = griddata(X, Y, Z, Xg, Yg);
figure(1)
surfc(Xg, Yg, Zg)
grid on

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by