Read vtk files (created from paraview) into Matlab

240 views (last 30 days)
Hi, I have many vtk files storing the velocity field information, which is created in Paraview. Now I want to import them into Matlab to do the proper orthogonal decomposition, so I need to convert the data into matrix. Is there any way to read the raw data files with the format of VTK into Matlab? Thanks!!
File format is unsupported for uploading, but it has the following structure:
# vtk DataFile Version 2.0
sampleSurface
ASCII
DATASET POLYDATA
POINTS 65994 double
-8.48e-09 -0.494167 2.49037e-18
-0.020125 -0.493765 -7.0605e-18
0.020125 -0.493765 -4.2448e-18
-0.0402182 -0.492564 3.31633e-18
0.0402182 -0.492564 2.02627e-18
-0.0602486 -0.490573 6.79711e-18
....
POLYGONS 130656 522624
3 62271 62194 62506
3 62398 62506 62194
3 62562 62341 62387
3 62562 62387 62506
3 62271 62387 62341
...
POINT_DATA 65994
FIELD attributes 1
vorticity 3 65994 float
-3.96689e-21 -1.08047e-19 6.97702
8.57664e-19 -2.68243e-19 7.95412
-6.37119e-19 -2.19501e-19 6.03446
-3.00809e-19 -1.42912e-19 8.96011
....

Accepted Answer

Walter Roberson
Walter Roberson on 4 Dec 2022

More Answers (0)

Tags

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!