Skip to content

Instantly share code, notes, and snippets.

@esmitt
Created December 7, 2017 13:32
Show Gist options
  • Save esmitt/917c8ffa484c492438c59d4c7b6469b7 to your computer and use it in GitHub Desktop.
Save esmitt/917c8ffa484c492438c59d4c7b6469b7 to your computer and use it in GitHub Desktop.
Script to display a simple file with 3D points x y z
%output2.txt is the file to read
fid = fopen('output2.txt','rt');
indata = textscan(fid, '%f %f %f', 'HeaderLines', 2);
fclose(fid);
cmp = jet(numel(indata{3})); %is the same using X or Y
scatter3(indata{1}, indata{2}, indata{3}, [], cmp);
@esmitt
Copy link
Author

esmitt commented Dec 7, 2017

The file is something like:
NUMBER
SIZE-1 SIZE-2 SIZE-3 SIZE-4 ... SIZE-N
x1 y1 z1
x2 y2 z2
....
xn yn zn
First 2 lines are ignored

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment