help with XYZ data file
I am trying to understand a XYZ datafile from a 3D file. Example file.
https://www.dropbox.com/scl/fi/9463jgix2t8bnz356s7ly/1-0331_06_mesh.xyz?rlkey=m73j8q1j9qqufe7xlqbockg68&st=vlsz2eoz&dl=0
I was able to google how to open the XYZ file in matlab and it gave me code that works (provided below) but I would like help manipulating the code. First question, I would like to be able to plot some of the planes of XY with fixed Z values/range. Can this be done direclty from the MATLAB variables XYZ used below? This seems to be making lines, it is some kind of vector data?
figure, imagesc(X(:,1),Y(:,1),Z(100:1000,1))
What is the scatterinterpolant doing? How can i get XY planes for each Z ?
clear
data = readmatrix(‘#1-0331_06_mesh.xyz’, ‘FileType’, ‘text’);
X = data(:,1);
Y = data(:,2);
Z = data(:,3);
% Create a grid
[xq, yq] = meshgrid(linspace(min(X), max(X), 100), linspace(min(Y), max(Y), 100));
% Interpolate Z values onto the grid. Different interploation methods
F = scatteredInterpolant(X, Y, Z);
zq = F(xq, yq);
% Plot the surface
figure, surf(xq, yq, zq);
shading interp; % Smooths the surface
axis equalI am trying to understand a XYZ datafile from a 3D file. Example file.
https://www.dropbox.com/scl/fi/9463jgix2t8bnz356s7ly/1-0331_06_mesh.xyz?rlkey=m73j8q1j9qqufe7xlqbockg68&st=vlsz2eoz&dl=0
I was able to google how to open the XYZ file in matlab and it gave me code that works (provided below) but I would like help manipulating the code. First question, I would like to be able to plot some of the planes of XY with fixed Z values/range. Can this be done direclty from the MATLAB variables XYZ used below? This seems to be making lines, it is some kind of vector data?
figure, imagesc(X(:,1),Y(:,1),Z(100:1000,1))
What is the scatterinterpolant doing? How can i get XY planes for each Z ?
clear
data = readmatrix(‘#1-0331_06_mesh.xyz’, ‘FileType’, ‘text’);
X = data(:,1);
Y = data(:,2);
Z = data(:,3);
% Create a grid
[xq, yq] = meshgrid(linspace(min(X), max(X), 100), linspace(min(Y), max(Y), 100));
% Interpolate Z values onto the grid. Different interploation methods
F = scatteredInterpolant(X, Y, Z);
zq = F(xq, yq);
% Plot the surface
figure, surf(xq, yq, zq);
shading interp; % Smooths the surface
axis equal I am trying to understand a XYZ datafile from a 3D file. Example file.
https://www.dropbox.com/scl/fi/9463jgix2t8bnz356s7ly/1-0331_06_mesh.xyz?rlkey=m73j8q1j9qqufe7xlqbockg68&st=vlsz2eoz&dl=0
I was able to google how to open the XYZ file in matlab and it gave me code that works (provided below) but I would like help manipulating the code. First question, I would like to be able to plot some of the planes of XY with fixed Z values/range. Can this be done direclty from the MATLAB variables XYZ used below? This seems to be making lines, it is some kind of vector data?
figure, imagesc(X(:,1),Y(:,1),Z(100:1000,1))
What is the scatterinterpolant doing? How can i get XY planes for each Z ?
clear
data = readmatrix(‘#1-0331_06_mesh.xyz’, ‘FileType’, ‘text’);
X = data(:,1);
Y = data(:,2);
Z = data(:,3);
% Create a grid
[xq, yq] = meshgrid(linspace(min(X), max(X), 100), linspace(min(Y), max(Y), 100));
% Interpolate Z values onto the grid. Different interploation methods
F = scatteredInterpolant(X, Y, Z);
zq = F(xq, yq);
% Plot the surface
figure, surf(xq, yq, zq);
shading interp; % Smooths the surface
axis equal xyz data, 3d data MATLAB Answers — New Questions









