Discretize the 3-D surface into individual points in MATLAB

9 views (last 30 days)
LM on 16 Jan 2022
Edited: LM on 22 Jan 2022
Hey guys!
how to discretize the 3-D surface into individual points in MATLAB.
For example, if I have a surface in x,y,z. I want to generate each curve (y,z) for x=-1,-0.9,-0.8 etc. Can you guys please give me some guidances for it, I would very appreciate it!

Answers (2)

KSSV on 16 Jan 2022
Read about slice. This is your function.

Walter Roberson
Walter Roberson on 16 Jan 2022
F = @(X, Y) sin(X).^2 - cos(3*Y).^2; %equation of the surface
xvec = -1:0.1:1;
yvec = -3.2:.1:3.2;
[x, y] = meshgrid(xvec, yvec);
z = F(x, y);
surf(x, y, z); xlabel('x'); ylabel('y'); zlabel('z')
z is your discretized data.
LM on 16 Jan 2022
Great thanks, Walter! Will give a try! Again, thank you so much!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!