![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/927214/image.png)
Reading a .dat file or .geom file in Matlab
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I have geometry files of a sphere which I want to visualize in matlab. The file name is "sphere.geom" or "sphere.dat". Both are the geometry files and I want to visualize them using matlab script in matlab or to convert them using matlab script to .vtk files so they can be visualized in paraview. I am attaching the files with the question as a zip file because of their extension.
Does anyone knows how it can be done or any links/hints?
0 Kommentare
Antworten (1)
yanqi liu
am 15 Mär. 2022
yes,sir,use direct read and sparse,can get data,may be check it,but how to view the data,may be consider more method.
fid = fopen('./sphere.dat', 'r');
for i = 1 : 6
tline = fgetl(fid);
end
data = [];
while ~feof(fid)
tline = fgetl(fid);
data = [data; str2num(tline)];
end
fclose(fid);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/927214/image.png)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!